POJ_1003_Hangover

来源:互联网 发布:mac推出u盘快捷键 编辑:程序博客网 时间:2024/05/22 10:27
#include<cstdio>using namespace std;int main(){ int i; double l, s; while (scanf("%lf", &l) && l != 0){for (s = 0.0, i = 2; (s += 1.0 / i) < l; i++);printf("%d card(s)\n", i - 1); }return 0;}

0 0
原创粉丝点击