| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
一次AC,小庆下,嘿嘿(贴程序)#include<iostream>
using namespace std;
int main()
{
float c;
int i;
float a[1000];
a[1]=0;
a[2]=0; i=2;
while(a[i-1]<=5.20){
a[i]=a[i-1]+1.0/i;
i++;
}
while(cin>>c && c!=0.00)
{
i=1;
while(c>a[i]){i++;}
cout<<i-1<<" card(s)"<<endl;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator