Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. signed int x,suma=0,ilosc=1,a,min,max;
  7. scanf("\n %d",&a);
  8. suma+=a;
  9. min=a;
  10. max=a;
  11. while(scanf("%i",&x))
  12. {
  13. suma+=x;
  14. if(x>max) max = x;
  15. if(x==0) break;
  16. if(x<min) min=x;
  17. ilosc++;
  18. }
  19. printf("Srednia: %.2f",(float)suma/ilosc);
  20. printf("\nMax: %d \nMin: %d",max,min);
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement