Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int max,A,B,C,D,E,suma=0,br=0;
- printf("Uneti redom vrednosti za slova A,B,C,D,E\n");
- scanf("%d\n%d\n%d\n%d\n%d",&A,&B,&C,&D,&E);
- max=A;
- if(B>max);
- {
- max=B;
- }
- if(C>max);
- {
- max=C;
- }
- if(D>max);
- {
- max=D;
- }
- if(E>max);
- {
- max=E;
- }
- if(A!=max)
- {
- suma+=A;
- br++;
- }
- if(B!=max)
- {
- suma+=B;
- br++;
- }
- if(C!=max)
- {
- suma+=C;
- br++;
- }
- if(D!=max)
- {
- suma+=D;
- br++;
- }
- if(E!=max)
- {
- suma+=E;
- br++;
- }
- if(br==0)
- {
- printf("Svi brojevi su isti");
- }else
- {
- printf("Srednja vrednost = %d/%d =%.2f",suma,br,(float)suma/br);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement