| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
递归程序.In Reply To:请问:怎么递归啊? Posted by:c0400330001 at 2004-05-29 22:21:00 Program p1664(Input,Output);
var i,j,t,n,m:integer;
k:longint;
Procedure digui(pi,i,ki:shortint);
var j:integer;
begin
if ki<pi then exit;
if (i=1) and (ki>=pi) then begin inc(k); exit; end;
for j:=pi to ((ki+3) div i) do digui(j,i-1,ki-j);
end;
Begin
readln(t);
for i:=1 to t do
begin
k:=0;
readln(m,n);
if n<>0 then digui(0,n,m);
writeln(k);
end;
End.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator