hdu--5078--orz

这应该是当时 鞍山的签到题了吧...

可以给大一的来做下 .

 1 #include <iostream>
 2 #include <cmath>
 3 #include <iomanip>
 4 using namespace std;
 5 
 6 double Abs( double x )
 7 {
 8     return x > 0 ? x : -x;
 9 }
10 
11 int main()
12 {
13     cin.sync_with_stdio(false);
14     int t , n;
15     double t1 , x1 , y1 , t2 , x2 , y2 , var , ans;
16     cin >> t;
17     while( t-- )
18     {
19         cin >> n;
20         cin >> t1 >> x1 >> y1;
21         ans = 0;
22         for( int i = 2 ; i<=n ; i++ )
23         {
24             cin >> t2 >> x2 >> y2;
25             var = sqrt( Abs(x2-x1)*Abs(x2-x1) + Abs(y2-y1)*Abs(y2-y1) ) / Abs(t2-t1);
26             ans = max( var , ans );
27             t1 = t2;
28             x1 = x2;
29             y1 = y2;
30         }
31         cout << setiosflags(ios::fixed);
32         cout << setprecision(10) << ans << endl;
33     }
34     return 0;
35 }
View Code

早上写了2题  晓爷你TMD 是不是还在睡觉!!

原文地址:https://www.cnblogs.com/radical/p/4116317.html