用数组储存每一个字符的密字,如果有重复或有位置空缺就Failed,否则翻译。var a,b,c:string;PRocedure init;begin readln(a); readln(b); readln(c);end;var s:array[65..90] of string; i:longint;begin init; for i:=1 to length(a) do if (s[ord(a[i])]='')and(s[ord(b[i])]<>b[i]) then s[ord(a[i])]:=b[i] else if b[i]<>s[ord(a[i])] then begin writeln('Failed'); exit; end; for i:=65 to 90 do if s[i]='' then begin writeln('Failed'); exit; end; for i:=1 to length(c) do write(s[ord(c[i])]);end.