Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

英雄们帮忙看看为啥不过

Posted by zq1227xjj101 at 2010-03-22 17:16:08 on Problem 2509
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator