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 clx19871120 at 2007-06-16 19:41:48 on Problem 1003
#include<iostream>
using namespace std;
int main(){
          double n;
		  double a[10];
		  int i;
		  int p=0;
		  for(i=0;i<10;i++)
		  {cin>>a[i];
		  if(a[i]==0.00)
			  break;
		  }
		  while(a[p]){
			  double k=0;
			  for(n=1;k<a[p];n++){
			  k+=1.00/(n+1);
			  }
			  cout<<n-1<<' '<<"card(s)"<<endl;
			  p++;
		  }
		  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