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> using namespace std; int main() { long long n,k; while(cin>>n>>k) { if(n==0&&k==0) break; __int64 answer=1; __int64 mol=1; __int64 den=1; if(k==0||k==n) ; else { if(k>n/2) k=n-k; for(int i=0;i<k;++i) { mol*=(n-i); den*=(i+1); } answer=mol/den; } printf("%I64d\n",answer); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator