Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main()
  6. {
  7.     int i = 1;
  8.     float res = 0;
  9.     float x = -1;
  10.     while (x != 0)
  11.     {
  12.         scanf("%f", &x);
  13.  
  14.         if (i % 4 == 0 && x > 150) x *= 0.9;
  15.         res += x;
  16.         i++;
  17.     }
  18.    
  19.     if (res - (int)res > 1e-4) res = (int) res + 1;
  20.  
  21.     long long ans = res;
  22.     printf("%lld", ans);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement