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

WA4
Posted by sftuit 19 Oct 2011 11:15
Help me to find a mistake, please

var
i,j,k,n,s:byte;
ping:array[1..1001] of string;
begin
 i:=0;j:=0;k:=0;
 readln(n);
 for s:=1 to n do
 begin
  readln(ping[s]);
  if ping[s]='Emperor Penguin' then i:=i+1 else
  if ping[s]='Macaroni Penguin' then k:=k+1 else
  if ping[s]='Little  Penguin' then j:=j+1;
 end;

 if (j>i) and (j>k) then writeln('Little Penguin');
 if (k>i) and (k>j) then writeln('Macaroni Penguin');
 if (i>k) and (i>j) then writeln('Emperor Penguin');

end.
Re: WA4
Posted by sftuit 19 Oct 2011 11:57
Hi!
Re: WA4
Posted by SquidBoy 19 Apr 2012 12:18
is a Byte going to be big enough to store the number of penguins of each type?