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:Re:为什么老超时??? Posted by:chenweifeng at 2006-05-05 18:09:01 #include<iostream> using namespace std; int main() { long n,k,sum,i,j; while(cin>>n>>k) { if(n==0&&k==0) break; sum=1; if(k!=0) for(i=n-k+1,j=1;i<n+1;i++,j++) sum = sum*i/j; cout<<sum<<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