|
|
back to boardwhy WA#8? Posted by Алексей 11 Mar 2011 18:02 here is my code/ Re: why WA#8? Posted by Алексей 11 Mar 2011 18:02 program Project1; {$APPTYPE CONSOLE} uses SysUtils; var s,s2:array[1..100] of string[30]; i,n,j,k:integer; begin readln(n); k:=1; for i:=1 to n do s2[i]:=''; for i:=1 to n do readln(s[i]); for i:=1 to n-1 do for j:=i+1 to n do if s[i] = s[j] then begin s2[k]:=s[i]; k:=k+1; end; for i:=1 to k-1 do for j:=i+1 to k do if s2[i] = s2[j] then s2[j]:=''; for i:=1 to k-1 do if s2[i] <> '' then writeln(s2[i]); end. |
|
|