标签:des c style class blog code
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 18704 | Accepted: 7552 |
Description
Input
Output
Sample Input
4 20 0 25 -155 27 190 30 240 2 21 0 22 34 0
Sample Output
780 771
Source
1 #include <iostream> 2 #include <cstdio> 3 #include <cmath> 4 using namespace std; 5 6 int main() 7 { 8 int n; 9 const double distance = 4.5; 10 while(scanf("%d",&n)!=EOF&&n!=0) 11 { 12 double x,t,v,min = 1e100; 13 for(int i =0 ;i<n;i++) 14 { 15 scanf("%lf%lf",&v,&t); 16 x =distance*3600/v+t; 17 if(t>=0&&x<min) 18 min = x; 19 } 20 printf("%.0lf\n",ceil(min)); 21 } 22 return 0; 23 }
标签:des c style class blog code
原文地址:http://www.cnblogs.com/jhldreams/p/3761371.html