#include<iostream>
#include<vector>
using namespace std;
int main()
{
//maxLen=0.0f;
float maxLen;
vector<float> lens;
vector<float> lenss;
while (true)
{
cin>>maxLen;
if(maxLen<0.001f)
{
break;
}
lens.push_back(maxLen);
}
lenss.push_back(1.0f/2);
vector<float>::iterator iter;
for(iter=lens.begin();iter!=lens.end();++iter)
{
int i=0;
while (lenss[i]<*iter)
{
if(i>=lenss.size()-1)
{
lenss.push_back(lenss[i]+(1.0f/(i+3)));
}
i+=1;
}
cout<<i+1<<" card(s)"<<endl;
}
return 0;
}
POJ1003
最新推荐文章于 2014-07-10 16:56:55 发布