|
|
вернуться в форумWhy WA #1? On my computer it is working correctly. var a : array [1..100, 1..100] of integer; result : array [1..20000] of integer; i, j, ah, b, n, count : integer; begin readln (n); for i := 1 to n do begin for j := 1 to n do read (a[i, j]); readln; end; for i := 1 to (n*2-1) do begin if (i < n) then begin ah := i; b := 1; end else begin ah := n; b := i - n + 1; end; while (ah>=1) do begin inc (count); result [count] := a [ah, b]; dec (ah); inc (b); end; end; for i := 1 to count do if (result [i] <> 0) then write (result [i]); writeln; end. Re: Why WA #1? I think u should write " " after each number |
|
|