1 solutions
-
0
Pascal :
program restore; var k,len:longint; b1,b2,b3:ansistring; function change(a,b,c:ansistring):boolean; var i:longint; t:char; begin for i:=1 to len div 2 do begin t:=a[i]; a[i]:=a[len-i+1]; a[len-i+1]:=t; end; for i:=1 to len do begin b[i]:=chr(ord(b[i])+k); if b[i]>'z' then b[i]:=chr(ord(b[i])-26); end; for i:=1 to len do begin c[i]:=chr(ord(c[i])-k); if c[i]<'a' then c[i]:=chr(ord(c[i])+26); end; if (a=b)and(b=c) then begin writeln(a); halt; end; end; procedure init; begin readln(len); readln(b1); readln(b2); readln(b3); end; procedure work; begin for k:=0 to 6 do begin change(b1,b2,b3); change(b1,b3,b2); change(b2,b1,b3); change(b2,b3,b1); change(b3,b2,b1); change(b3,b1,b2); end; end; begin init; work; end.
- 1
Information
- ID
- 798
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 10
- Tags
- (None)
- # Submissions
- 8
- Accepted
- 0
- Uploaded By