wojiaocbj

gpa

Apr 9th, 2022
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3.     double gpx = 0., hx = 0.;
  4.     double g, h;
  5.     while(~scanf("%lf%lf", &g, &h)){
  6.         hx += h;
  7.         if(g >= 60.){
  8.             gpx += (4 - 3. * (100. - g) * (100. - g) / 1600.) * h;
  9.         }
  10.     }
  11.     printf("%.2f\n", gpx / hx);
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment