Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

怎么错了呢????谢谢啦,帮哈忙!

Posted by yi_chen2 at 2007-05-20 13:21:15 on Problem 1003
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator