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 1319. Hotel

WA 4 Help!!
Posted by Alexandr-pro 8 Oct 2013 06:52
var
   i,j,n:word;
   a:array[1..100] of word;
begin
     readln(n);
     a[1]:=1;
     for i:=2 to n do
         a[i]:=a[i-1]+i-1;

     for j:=n downto 1 do
         begin
              for i:=n downto 1 do
                  write(a[i]:3);
              for i:=1 to n-1 do
                  a[i]:=a[i+1]+1;
              a[n]:=a[n]+j;
              writeln;
          end;
end.