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 |
Re:英雄们帮忙看看为啥不过In Reply To:英雄们帮忙看看为啥不过 Posted by:zq1227xjj101 at 2010-03-22 17:16:08 > #include <stdio.h> > way (int M,int N); > void main () > { > int nub,total; > int M,N; > scanf ("%d\n",&nub); > while (nub>0) > { > scanf ("%d %d",&M,&N); > total=way(M,N); > printf("%d\n",total); > nub--; > } > } > way(int M,int N) > { > if (M < 0) return 0; > if (M == 0) return 1; > if (N == 1) return 1; > return way(M - N, N) +way(M, N - 1); > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator