nikolas_serafini

Lista 2 - Exercício 32

May 26th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     float first,second,third,med;
  7.        
  8.     printf("Entre com os tres valores :\n"); scanf("%f %f %f",&first,&second,&third);
  9.     if ((first>=second)&&(first>=third)) med = (first*5 +2*(second+third))/3;
  10.     if ((second>=first)&&(second>=third)) med = (second*5 +2*(first+third))/3;
  11.     if ((third>=first)&&(third>=second)) med = (third*5 +2*(first+second))/3;
  12.  
  13.     printf("Media ponderada : %f\n",med);
  14.    
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment