pku acm 1003

来源:互联网 发布:免费领取流量软件 编辑:程序博客网 时间:2024/06/05 16:49
#include<iostream>
using namespace std;

int main(){
float length,temp;
int maxNum(0);
while(cin>>length){
while(length>0){
++maxNum;
temp=1.0f/(maxNum+1);
length-=temp;
}
if(maxNum!=0){
cout<<maxNum<<" card(s)"<<endl;
maxNum=0;
}
else
break;
}

return 0;
}
0 0
原创粉丝点击