#include“stdio.h”
int main(){
while(1){
float sum=0.5,num;
int card=2;
scanf("%f",&num);
if(num==0.00){
break;
}else if(num>=5.20){
continue;
}
else if(num<=0.5)
printf("1 Card(s)\n");
else
if(num>sum){
while(num>sum){
card++;
sum+=(float)1/card;
}
printf("%d Card(s)\n",card-1);
}
}
return 0;
}
http://blog.csdn.net/sinchb/article/details/8097071
http://blog.csdn.net/lijiecsu/article/details/7383428
出錯可能是一些用例不通過,代碼bug,或者超時超內存,或者輸入輸出格式不對。