| ||||||||||
| 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 | |||||||||
怎么错了呢????谢谢啦,帮哈忙!#include<iostream.h>
int f(float a)
{
float sum=0,i=2.0;
int j=0;
do{
sum+=1/i;
i++;
j++;
}while((sum-a)<0);
return j;
}
int main(void)
{
float *a=new float[];
for(int k=0;a[k-1]!=0.00;k++)
cin>>a[k];
for(k=0;a[k]!=0.0;k++)
{
if(a[k]>=0.01&&a[k]<=5.20)
for(k=0;a[k]!=0.00;k++)
cout<<f(a[k])<<" 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