ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1585. Penguins

Pascal Compilation error. Why?
Posted by Michael 20 Aug 2013 19:55
It works on my laptop. I have Pascal ABC.
var A:array[1..1000]of string;
B:array[1..3]of integer;
c,d:integer;
begin
for d:=1 to c do begin
if A[d]='Emperor Penguin'then B[1]+=1;
if A[d]='Little Penguin'then B[2]+=1;
if A[d]='Macaroni Penguin'then B[3]+=1;
end;
d:=max(max(B[1],B[2]),B[3]);
if d=B[1]then write('Emperor Penguin');
if d=B[2]then write('Little Penguin');
if d=B[3]then write('Macaroni Penguin');
end.
Re: Pascal Compilation error. Why?
Posted by Treasure 21 Aug 2013 14:39
function max(x,y:integer):integer;
begin
if x>=y then max:=x
else max:=y;
end;
Re: Pascal Compilation error. Why?
Posted by Michael [SESC UrFU] 23 Aug 2013 10:57
Thanks. I didn't know that FreePascal doesn't know this function max().

Edited by author 23.08.2013 10:58