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

欲哭无泪,谁能帮我看看,我这代码是什么原因WA了~~~

Posted by gbastc at 2011-07-08 21:54:50 on Problem 1922
#include <stdio.h>
#include <iostream>
using namespace std;
#define MIN 1e-8
int main()
{
	int n,i,v,t;
	double ans;
	while(scanf("%d",&n),n)
	{
		ans=INT_MAX;
		scanf("%d%d",&v,&t);
		ans=3.6*4500/v+t;
		for(i=1;i<n;i++)
		{
			scanf("%d%d",&v,&t);
			if(3.6*4500/v+t<ans&&t>=0)
				ans=3.6*4500/v+t;
		}
		if(ans-int(ans)>0.0)
			printf("%d\n",int(ans)+1);
		else printf("%.lf\n",ans);
	}
	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