Untitled

mail@pastecode.io avatar
unknown
pascal
2 years ago
697 B
5
Indexable
Never
uses crt;
var i,n,j:longint;
    a,b:array[1..100] of string;
procedure sort(var s:string);
var i,j:integer;
    t:char;
begin
        for i:=1 to length(s) do
        for j:=i+1 to length(s) do
        if s[i]>s[j] then
        begin
                t:=s[i];
                s[i]:=s[j];
                s[j]:=t;
        end;
end;
begin
        clrscr;
        readln(n);
        for i:=1 to n do
        begin
                readln(a[i]);
                b[i]:=a[i];
                sort(b[i]);
        end;
        for i:=1 to n do
        for j:=i+1 to n do
        if (b[i]=b[j]) and (length(b[i])=length(b[j])) then writeln(a[i],' ',a[j]);
        readln;
end.