ZOJ Problem Set

#include <stdio.h>

int main()
{
	float c;
	int i;
	while(scanf("%f",&c)!=EOF&&c)
	{
		float sum=0;
		for(i=2;sum<c;i++)
		{
			sum+=(1.0/i);
		}
		printf("%d card(s)
",i-2);
	}
		
	return 0;
}

  简单不多说了

原文地址:https://www.cnblogs.com/xlturing/p/3300517.html