#include <stdio.h>
#include <stdlib.h>
int main()
{
int m,n;
double x;
scanf("%d %d",&n,&m);
while(n!=0){
x = 1;
for(int i=m+1;i<=n;i++){
x *= (double)i;
x /= (double)(i-m);
}
printf("%.0f\n",x);
scanf("%d %d",&n,&m);
}
return 0;
}
為什麼會TLE啊QQ
#include
#include
int main()
{
int m,n;
double x;
scanf("%d %d",&n,&m);
while(n!=0){
x = 1;
for(int i=m+1;i<=n;i++){
x *= (double)i;
x /= (double)(i-m);
}
printf("%.0f\n",x);
scanf("%d %d",&n,&m);
}
return 0;
}
為什麼會TLE啊QQ
語法要讀熟喔 .
你的程式只讀一筆輸入資料而已
#include
#include
int main()
{
int m,n;
double x;
scanf("%d %d",&n,&m);
while(n!=0){
x = 1;
for(int i=m+1;i<=n;i++){
x *= (double)i;
x /= (double)(i-m);
}
printf("%.0f\n",x);
scanf("%d %d",&n,&m);
}
return 0;
}
為什麼會TLE啊QQ
語法要讀熟喔 .
你的程式只讀一筆輸入資料而已