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 |
奇怪..为什么用__int64过不了,而用double就AC了,请大牛们帮看下...#include<stdio.h> int main() { int M,N,i,j; double sum; while(scanf("%d%d",&M,&N)!=EOF) { if(M==0&&N==0) break; sum=1; for(i=M,j=1;i>=M-N+1;i--,j++) { sum=sum/j*i; } printf("%d things taken %d at a time is %.lf exactly.\n",M,N,sum); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator