mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
588 B
C++
25 lines
588 B
C++
|
#include <cstdlib>
|
||
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
int main()
|
||
|
{
|
||
|
double examples[300],enter;
|
||
|
int numDenominator=3,circleA;
|
||
|
examples[0]=1.0/2.0;
|
||
|
for(circleA=1;circleA<280;circleA++){
|
||
|
examples[circleA]=examples[circleA-1]+1.0/(double)(numDenominator++);
|
||
|
}
|
||
|
while(cin>>enter){
|
||
|
if(0.00==enter){
|
||
|
break;
|
||
|
}
|
||
|
for(circleA=0;circleA<280;circleA++){
|
||
|
if(examples[circleA]>=enter){
|
||
|
cout<<circleA+1<<" card(s)"<<endl;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|