Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- float a, b, c, d, e, all[4], aux, soma=0;
- scanf("%f %f %f %f %f", &a, &b, &c, &d, &e);
- all[0] = a; all[1] = b; all[2] = c; all[3] = d; all[4] = e;
- for(int j=0; j<=4; j++){
- for(int i=0; i<=3; i++)
- if(all[i]>all[i+1]){
- aux=all[i];
- all[i]=all[i+1];
- all[i+1]=aux;
- }
- }
- soma = all[1] + all[2] + all[3];
- printf("%2.1f", (soma));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement