ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

1712
Posted by data lapiashvili 25 Oct 2009 16:02
var
  c,c1,c2 :array[1..4,1..4]of char;
  i2,i,j,i1,j1 :byte;
begin
  i1:=0;
  for i:=1 to 8 do
    begin
      i1:=i1+1;
      j1:=0;
      for j:=1 to 4 do
        begin
          j1:=j1+1;
          if i1<5 then
            if j1<4 then read(c[i1,j1]);
          if j1<4 then
            if i1>4 then read(c1[i1-4,j1]);
          if i1<5 then
            if j1=4 then readln(c[i1,j1]);
          if j1=4 then
            if i1>4 then readln(c1[i1-4,j1]);
        end;
    end;
  for i:=1 to 4 do
     begin
       i2:=0;
       for i1:=1 to 4 do
         begin
           j1:=0;
           i2:=i2+1;
           for j:=1 to 4 do
             begin
               j1:=j1+1;
               if c[i2,j1]='x' then write(c1[i2,j1]);
             end;
         end;
       i2:=0;
       for i1:=1 to 4 do
         begin
           i2:=i2+1;
           j1:=0;
           for j:=1 to 4 do
             begin
               j2:=j1+1;
               c2[i2,5-j1]:=c[j1,i2];
             end;
         end;
    c:=c2;
     end;
end.