Advertisement
rdsedmundo

code.c

Apr 20th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     float a, b, c, d, e, all[4], aux, soma=0;
  6.     scanf("%f %f %f %f %f", &a, &b, &c, &d, &e);
  7.     all[0] = a; all[1] = b; all[2] = c; all[3] = d; all[4] = e;
  8.         for(int j=0; j<=4; j++){
  9.             for(int i=0; i<=3; i++)
  10.                 if(all[i]>all[i+1]){
  11.                     aux=all[i];
  12.                     all[i]=all[i+1];
  13.                     all[i+1]=aux;
  14.                 }
  15.         }
  16.  
  17.     soma = all[1] + all[2] + all[3];
  18.  
  19.     printf("%2.1f", (soma));
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement