| ||||||||||
| 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 | |||||||||
我AC了,大家参考一下#include<stdio.h>
void main()
{ double sum;
unsigned long i,n,k;
scanf("%ld %ld",&n,&k);
while(n!=0)
{
sum=1;
if(k>n/2) k=n-k;
for( i=1;i<=k;i++)
{ sum=sum/i;
sum=sum*(n-i+1);
}
printf("%.0f\n",sum);
scanf("%ld %ld",&n,&k);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator