Hangover(1003)

#include <iostream>
#include <string>
using namespace std;

void main()
{
string card="card(s)";
double num=2;
double res=0;
double end;
cin>>end;
int what=0;
while (res<=end)
{
res+=1/(num++);
what++;
}
if (end>0)
cout<<what<<" "<<card<<endl;
}
原文地址:https://www.cnblogs.com/tiandsp/p/2343983.html