水题,群起而水之~

View Code
1 #include <cstdio>
2
3 usingnamespace std;
4
5 int main()
6 {
7 double tmpx,tmpy;
8 double x,y,px,py;
9 while (scanf("%lf %lf",&px,&py) ==2)
10 {
11 tmpx =0;
12 tmpy =0;
13 if (px ==-1&& py ==-1) break;
14 while (scanf("%lf %lf",&x,&y) ==2)
15 {
16 if (x ==0&& y ==0) break;
17 if (y < py)
18 {
19 tmpx += x - px;
20 tmpy += py - y;
21 }
22 px = x;
23 py = y;
24 }
25 printf("%.0lf\n",py * tmpx / tmpy);
26 }
27 return0;
28 }

相关文章:

  • 2021-10-30
  • 2022-02-14
  • 2021-07-22
  • 2021-05-22
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2021-05-31
相关资源
相似解决方案