Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int max,A,B,C,D,E,suma=0,br=0;
  6. printf("Uneti redom vrednosti za slova A,B,C,D,E\n");
  7. scanf("%d\n%d\n%d\n%d\n%d",&A,&B,&C,&D,&E);
  8. max=A;
  9. if(B>max);
  10. {
  11. max=B;
  12. }
  13. if(C>max);
  14. {
  15. max=C;
  16. }
  17. if(D>max);
  18. {
  19. max=D;
  20. }
  21. if(E>max);
  22. {
  23. max=E;
  24. }
  25. if(A!=max)
  26. {
  27. suma+=A;
  28. br++;
  29. }
  30. if(B!=max)
  31. {
  32. suma+=B;
  33. br++;
  34. }
  35. if(C!=max)
  36. {
  37. suma+=C;
  38. br++;
  39. }
  40. if(D!=max)
  41. {
  42. suma+=D;
  43. br++;
  44. }
  45. if(E!=max)
  46. {
  47. suma+=E;
  48. br++;
  49. }
  50. if(br==0)
  51. {
  52. printf("Svi brojevi su isti");
  53. }else
  54. {
  55. printf("Srednja vrednost = %d/%d =%.2f",suma,br,(float)suma/br);
  56. }
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement