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

my successful code !!!
Posted by david 28 Apr 2013 20:58
var n,i,e,l,m,max:integer;
    s,maxw:string;
begin
 readln(n);
 e:=0;
 l:=0;
 m:=0;
 for i:=1 to n do
  begin
   readln(s);
   if s[1]='E' then e:=e+1;
   if s[1]='L' then l:=l+1;
   if s[1]='M' then m:=m+1;
  end;
  if e>l then
   begin
    max:=e;
    maxw:='Emperor Penguin';
   end
  else
   begin
    max:=l;
    maxw:='Little Penguin';
   end;
  if m>max then
   begin
    max:=m;
    maxw:='Macaroni Penguin';
   end;
 writeln(maxw);
end.