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 visual at 2006-03-28 13:22:10
#include<iostream>
using namespace std;

int main()
{
	double sum=0.0,num=0.0;
	int i=2;
	while(cin>>num)
	{
		
		if(num == 0.00)
		 break;
		else{
		
         sum=0.0;
         i=2;
	    while(sum<=num)
		{
        sum+=1.0/i;
	    i++;
		}
    	cout<<(i-2)<<" "<<"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