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 123456jojo at 2007-06-02 00:20:16
#include<stdio.h>
int n,m; 
int SetApple(int n, int  m)
{
    if(m==0)
    	return 0;
    else { if(n==0)
		     return 1; 
	        else if(n<0) 
		           return 0;
         }
	return SetApple(n-m, m) + SetApple(n, m - 1);
}


 int main(void)
{
 int i,t;
  scanf("%d",&t); 
  if(t>=0&&t<=20) {
 printf("Two positive integers n and m, separated by one space. (1<=n,m<=10)\n ");
 
scanf("%d %d",&n,&m);
if(n>=1&&n<=10&&m>=1&&m<=10) 
 { i=SetApple(n,m);
  printf("%d\n",i);}}
 
 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