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:那位大婶帮忙看一下是啥子故障嘛。。。。 Posted by:zhuhaiwen at 2009-05-12 17:01:59 > #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