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 bjtu_huanglu at 2007-01-18 12:34:51
我刚刚上北大acm不久,现在做Problem1003。下面是我的程序:
#include <iostream>
#include <vector>
using namespace std;
float overhang(float length)
{
	float sum=0;
	float n=2;
	while(1)
	{
		sum=sum+1/n;
		if(sum>=length)
		{
			return n;
		}
		n++;
	}
	
}
int main()
{
	vector<int>answer;
	float c;
	cin>>c;
	while(c!=0)
	{
		if(c>0.01&&c<5.20)
		{
			answer.push_back((int)overhang(c)-1);
			cin>>c;
		}
	}
	for(int i=0;i<answer.size();i++)
		cout<<answer[i]<<"card(s)"<<endl;
	return 0;
} 
每次提交,它都说是Presentation Error。
我郁闷了!
请各位帮帮忙!!!
谢谢!

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