Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- freopen("input.txt", "r", stdin);
- FILE *fp;
- fp = fopen("output.txt", "w");
- double A,B,C, MEDIA;
- while(scanf("%lf %lf %lf", &A, &B, &C) != EOF)
- {
- A = A*2;
- B = B*3;
- C = C*5;
- MEDIA = (A+B+C)/(2+3+5);
- printf("%0.1lf\n", MEDIA);
- fprintf(fp, "%0.1lf\n", MEDIA);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement