Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float A, B, C, D, E, maior, menor, soma;
- scanf("%f %f %f %f %f", &A, &B, &C, &D, &E);
- if(A<5 || A>10 || B<5 || B>10 || C<5 || C>10 || D<5 || D>10 || E<5 || E>10) return 0;
- if(A>=B && A>=C && A>=D && A>=E) maior=A;
- else if(B>=A && B>=C && B>=D && B>=E) maior=B;
- else if(C>=A && C>=B && C>=D && C>=E) maior=C;
- else if(D>=A && D>=B && D>=C && D>=E) maior=D;
- else maior=E;
- if(A<=B && A<=C && A<=D && A<=E) menor=A;
- else if(B<=A && B<=C && B<=D && B<=E) menor=B;
- else if(C<=A && C<=B && C<=D && C<=E) menor=C;
- else if(D<=A && D<=B && D<=C && D<=E) menor=D;
- else menor=E;
- soma=A+B+C+D+E-maior-menor;
- printf("%.1f", soma);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement