Description
Input
Output
Sample Input
4 20 0 25 -155 27 190 30 240 2 21 0 22 34 0
Sample Output
780 771
思路:此乃水题一道,不过要小心被坑。 Round up (ceiling) the value when dealing with a fraction:小数取整的话取不小于它的最小整数。
#include <stdio.h>
int main()
{
int n,v,t;
double min,temp;
while(~scanf("%d",&n) && n)
{
min=99999999;
while(n--)
{
scanf("%d%d",&v,&t);
if(t>=0)
{
temp=4.5/v*3600+0.4+t;
if(temp<min) min=temp;
}
}
printf("%.0lf\n",min);
}
return 0;
}
原文:http://blog.csdn.net/faithdmc/article/details/18701993