| ||||||||||
| 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>
#include<iomanip>
using namespace std;
int main()
{
int n,k;
while((cin>>n>>k)&&(n!=0)&&(k!=0))
{
double s=1,s1=1;
int i;
if(k>n/2)k=n-k;
for(i=1;i<=k;i++)
{
s=s*(n-i+1);
s1=s1*i;
}
s=s/s1;
cout<<setiosflags(ios::fixed)<<setprecision(0)<<s<<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