| ||||||||||
| 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: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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator