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<stdio.h> __int64 a,b; long C(long n,long m) { int i,j; a=1; b=1; if(m>n/2) m=n-m; for(i=n,j=1;j<=m;i--,j++) { a*=i; b*=j; if(a%b==0) { a/=b; b=1; } } return a/b; } int main() { long n,m; while(scanf("%ld%ld",&n,&m)!=EOF&&n!=0) printf("%ld\n",C(n,m)); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator