|
|
back to boardCommon BoardI need your help - Problem 1017 - Staircase Please, help to me with the staircase - problem 1017 It always gives mi "Acces Violation Crash". Why? Re: I need your help - Problem 1017 - Staircase Posted by LYS 21 Jul 2001 10:39 > Please, help to me with the staircase - problem 1017 > It always gives mi "Acces Violation Crash". Why? Maybe you generated a "Range Check Error" or something like that. Re: I need your help - Problem 1017 - Staircase > > Please, help to me with the staircase - problem 1017 > > It always gives mi "Acces Violation Crash". Why? > Maybe you generated a "Range Check Error" or something like > that. Here is my program. Have a look at it and if you can - help meprogram staircase; const max=60; var n,i,j:longint; a:array[0..max,0..max]of real; procedure br(n:integer); var i,j:integer; begin for i:=1 to n do for j:=1 to n do if j=1 then a[i,j]:=0 else if (j*(j+1)div 2)<i then a[i,j]:=0 else if j=i then a[i,j]:=1+a[j,j-1] else if (j=i-1)then a[i,j]:=1+a[i,j-1] else if j>i then a[i,j]:=a[i,i] else a[i,j]:=a[i-j,j-1]+a[i,j-1]; end; begin readln(n); br(n); writeln(round(a[n,n]-1)); end. |
|
|