ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1585. Penguins

Michael Pascal Compilation error. Why? [2] // Problem 1585. Penguins 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
readln(c);
for d:=1 to c do begin
readln(A[d]);
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.
Treasure Re: Pascal Compilation error. Why? [1] // Problem 1585. Penguins 21 Aug 2013 14:39
function max(x,y:integer):integer;
begin
if x>=y then max:=x
else max:=y;
end;
Michael [SESC UrFU] Re: Pascal Compilation error. Why? // Problem 1585. Penguins 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