ZOJ1045 handover解答。

os posted @ 2013年9月09日 11:43 in ACM , 749 阅读

acm 题目List

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1045

#include <stdio.h>

int main()
{
	float c;
	while(scanf("%f", &c) && c !=0)
	{
		int i = 2;
		float fResult = 0;
		while (fResult < c)
		{
			fResult += 1.00/i;
			i++;
		}
		printf("%d card(s)\n", i - 2);
	}
	return 0;
}

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter