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

Discussion of Problem 1506. Columns of Numbers

WHY WA#3
Posted by Looser 31 Mar 2008 03:18
This my code:

var
    a:array[1..100,0..100] of integer;
    i,n,k,ki,kj,j,kn:integer;
begin
readln(n,k);
kn:=k;

k:=n div k+1;
if kn=n then k:=1;
ki:=1;
kj:=1;
for i:=1 to n do
 begin
  read(j);
  a[ki,kj]:=j;
  inc(a[ki,0]);
  inc(ki);
  if ki>k then begin ki:=1;
                      inc(kj);
               end;
 end;
 for i:=1 to k do
 begin
   for j:=1 to a[i,0] do
    write(a[i,j]:4);
 writeln;
 end;
end.



plz help me!

Edited by author 31.03.2008 03:19
Re: WHY WA#3
Posted by watashi 13 Oct 2011 01:06
9 3
1 2 3 4 5 6 7 8 9

=>

   1   4   7
   2   5   8
   3   6   9