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;
}
posted @ 2012-02-09 15:10  Dsp Tian  阅读(395)  评论(0编辑  收藏  举报