Advertisement
ahamed210

v_j1

Nov 30th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     freopen("input.txt", "r", stdin);
  7.     FILE *fp;
  8.     fp = fopen("output.txt", "w");
  9.     double A,B,C, MEDIA;
  10.     while(scanf("%lf %lf %lf", &A, &B, &C) != EOF)
  11.     {
  12.         A = A*2;
  13.         B = B*3;
  14.         C = C*5;
  15.         MEDIA = (A+B+C)/(2+3+5);
  16.         printf("%0.1lf\n", MEDIA);
  17.         fprintf(fp, "%0.1lf\n", MEDIA);
  18.     }
  19.  
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement