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 |
为什么用递推不对呀~~Runtime Error#include <iostream> using namespace std; long long f(long long n,long long m) { if(n==0||m==0) return 1; if(n!=0&&m!=0) return f(n-1,m)+f(n,m-1); } int main() { long long n,m; while(cin>>n>>m) { if(n==0&&m==0) break; else cout<<f(n,m)<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator