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 KEENIRVANA at 2007-09-23 15:21:40 on Problem 1003
#include<iostream>
using namespace std;
int main()
{int i=2,j=0,k;
float len=0;
float length[100];
int count=0;
for(j;;j++)
{cin>>length[j];

 if(length[j]==0.00)
	 break;
}

    for(k=0;k<j;k++)
	{
		for(i=2;len<length[k];i++)   
	{
	len+=1.00/i;
	count++;
	}
if(length[k]>=0.01&&length[k]<=5.2)	
cout<<count<<" 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