| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
欲哭无泪,谁能帮我看看,我这代码是什么原因WA了~~~#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator