Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- signed int x,suma=0,ilosc=1,a,min,max;
- scanf("\n %d",&a);
- suma+=a;
- min=a;
- max=a;
- while(scanf("%i",&x))
- {
- suma+=x;
- if(x>max) max = x;
- if(x==0) break;
- if(x<min) min=x;
- ilosc++;
- }
- printf("Srednia: %.2f",(float)suma/ilosc);
- printf("\nMax: %d \nMin: %d",max,min);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement