2019-11-28
1003 简化代码,也别把问题想复杂
#include <stdio.h>
#include <stdlib.h>
int main()
{
float c,sum,base;
int count;
scanf("%f",&c);
while(c!=0.00) { base=2; sum=1/base; count=1; while(sum<c) { base++; sum+=1/base; count++; } printf("%d card(s)\n",count); scanf("%f",&c); } return 0; }