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 yuewuya at 2010-04-28 23:25:30 on Problem 1922
#include<stdio.h>
typedef struct ad
{
	int x;
	int start;
	double time;
}Q;
Q a[100008];
int main()
{
	int i,j,n;
	double min,k;
	int m;
	while(scanf("%d",&n)!=EOF&&n!=0)
	{
		for(i=0;i<n;i++)
		{
			scanf("%d %d",&a[i].x,&a[i].start);
			if(a[i].start>=0)
			{
				a[i].time=a[i].start*1.0+4500*3.6/a[i].x;
			}
		}
		i=0;
		while(a[i].start<0)
			i++;
		min=a[i].time;
		for(j=i+1;j<n;j++)
		{
			if(a[j].start>0&&a[j].time<min)
				min=a[j].time;
		}
		m=(int)min;
		k=(double)m;
		if(min==k)
			printf("%d\n",m);
		else
			printf("%d\n",m+1);
	}
	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