|
|
back to boardWrong Answer var n,i,j,so,dong,cot : longint; a : array[1..100,1..100] of longint; b : array[1..100] of longint; begin readln(n); for i:=1 to n do begin for j:=1 to n do read(a[i,j]); readln; end; so := 0; cot := 1; dong := 1; repeat i := dong; j := cot; repeat so := so + 1; b[so] := a[i,j]; i := i - 1; j := j + 1; until ((j>n) or (i=0)); cot := 1; dong := dong + 1; until (dong>n); cot := 2; dong := n; repeat i := dong; j := cot; repeat so := so + 1; b[so] := a[i,j]; i := i - 1; j := j + 1; until ((j>n) or (i=0)); dong := n; cot := cot + 1; until (cot>n); for i:=1 to so do begin write(b[i],' '); end; end. I couldn't understand why it is incorrect ? :( Oh my godness :) ! (+) Try the following test: 1 1 Your program's output is '1 0', but the correct one is obviously '1'. P.S. Your code is unforgettable :) Re: Oh my godness :) ! (+) Thanks :) >> P.S. Your code is unforgettable :) Why ? :) |
|
|