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

Re:额。。都不说清楚。。

Posted by qylsw at 2010-07-09 20:35:15 on Problem 1664
In Reply To:额。。都不说清楚。。 Posted by:damacheng009 at 2010-05-29 15:48:14
#include<iostream>
using namespace std;
int select(int a,int b)
{
	if(a<0) return 0;
    if(a==0||b==1) return 1;
    else return (select(a-b,b)+select(a,b-1));
 }

int main()
{
	int x;
	scanf("%d",&x);
	while(x--){
		int a,b;
		scanf("%d%d",&a,&b);
		printf("%d\n",select(a,b));
	}
	return 0;
}
		

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