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 binbinyouli at 2006-04-06 21:51:29
#include <iostream>
using namespace std;
#define N 100
int  main()
{
   float max,sum,*a;
   int i=1,n=0,k=0;
   a=new float[N];
   while(true)
   {
	   if(n>=N) break;
	   cin>>a[n];
	   //cout<<endl;
	   if(a[n]==0.0) break;
	   n++;
   }
   while(k<n)
   {
      max=a[k]; 
	  sum=0.0; 
	  i=1;
      while(true)
     {
	     sum+=1.0/(i+1);
	     if(sum>=max) 
		 {
             cout<<i<<"card(s)"<<endl;
			 break;
		 }
		 else  i++;
      }
	 k++;
   }
   delete []a;
   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