Pagini recente » Cod sursa (job #2985619) | Cod sursa (job #183794) | Cod sursa (job #1806313) | Cod sursa (job #2221) | Cod sursa (job #136938)
Cod sursa(job #136938)
var f:text;
v:array[1..3700] of string[16];
n,i,nr:longint;
s,auxs:string[16];
aux:char;
ok:boolean;
begin
assign(f,'restante.in');
reset(f);
readln(f,n);
for i:=1 to n do begin
readln(f,s);
repeat
ok:=true;
for i:=1 to length(s)-1 do
if s[i]>s[i+1] then begin
aux:=s[i];
s[i]:=s[i+1];
s[i+1]:=aux;
ok:=false;
end;
until ok;
v[i]:=s;
end;
repeat
ok:=true;
for i:=1 to n-1 do
if v[i]>v[i+1] then begin
auxs:=v[i];
v[i]:=v[i+1];
v[i+1]:=auxs;
ok:=false;
end;
until ok;
if v[1]<>v[2] then nr:=1
else nr:=0;
for i:=2 to n do
if v[i]<>v[i-1] then nr:=nr+1;
close(f);
assign(f,'restante.out');
rewrite(f);
write(f,nr);
close(f);
end.