【水滴石穿】1003

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; }

猜你喜欢

转载自www.cnblogs.com/calm-blogme/p/11966987.html
今日推荐