NYOJ 156 Hangover

原题链接

简单题。

附ac代码:

#include <stdio.h>

int main(){
	int n;
	double x, s;
	while(scanf("%lf", &x), x){
		s = 0;
		n = 1;
		while(s < x)
			s += 1.0 / ++n;
		printf("%d card(s)\n", n - 1);
	}
	return 0;
}


posted on 2014-02-13 11:22  长木Qiu  阅读(92)  评论(0编辑  收藏  举报