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 |
这种做法是不行的#include <iostream> const int N=100; using namespace std; unsigned long C[N+1][N+1]; int main() { for(int i=1;i<=N;i++) { C[i][0]=1; C[i][i]=1; } for(int i=1;i<=N-1;i++) for(int j=i+1;j<=N;j++) { C[j][i]=C[j-1][i-1]+C[j-1][i]; } int n,m; cin>>n>>m; while((n+m)!=0) { cout<<C[n][m]<<endl; cin>>n>>m; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator