#8130: why


cuh127 (futurhack~~~~~興國猩國也(絕對沒有在污辱女性))

學校 : 臺南市私立興國高級中學
編號 : 28132
來源 : [203.68.26.150]
最後登入時間 :
2014-04-02 16:51:03
d134. 00369 - Combinations -- UVa369 | From: [118.233.187.216] | 發表日期 : 2013-08-23 23:26

您的答案為: 69 things taken 21 at a time is 269807672771096448 exactly. 正確答案為: 69 things taken 21 at a time is 269807672771096460 exactly. 
#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
int i,j,a,b;double c;
while(scanf("%d%d",&a,&b)!=EOF)
{if(a==0&&b==0)
break;
c=a;
for(i=a-1;i>=a-b+1;i--)
{c=c*i;
}
      for(i=1;i<=b;i++)
      c=c/i;
printf("%d things taken %d at a time is %.0lf exactly.\n",a,b,c);
}
return 0;
}
哪錯了
 
ZeroJudge Forum