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 1446. Sorting Hat

what is wrong? Pascal
Posted by Kirill Pugachev 14 Nov 2011 19:41
var n,i,j,k:integer;
s,h,g,r:string;
a:array[1..200] of string;

begin
s:='Slytherin';
h:='Hufflepuff';
g:='Gryffindor';
r:='Ravenclaw';

readln(n);
for i:=1 to 2*n do readln(a[i]);

writeln(s,':');
for i:=2 to 2*n do
if a[i]=s then writeln(a[i-1]);
writeln;

writeln(h,':');
for i:=2 to 2*n do
if a[i]=h then writeln(a[i-1]);
writeln;

writeln(g,':');
for i:=2 to 2*n do
if a[i]=g then writeln(a[i-1]);
writeln;

writeln(r,':');
for i:=2 to 2*n do
if a[i]=r then writeln(a[i-1]);
end.
Re: what is wrong? Pascal
Posted by TinyJanssen 28 Oct 2012 18:07
a:array[1..2000] of string;