Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int b;
  5. scanf("%d",&b);
  6. int i,a[b],max,min;
  7. for(i=0; i<b; i++)
  8. {
  9. scanf("%d",&a[i]);
  10. }
  11.  
  12.  
  13. a[0]=max;
  14. a[0]=min;
  15.  
  16. for(i=0; i<b; i++)
  17. {
  18. if(a[i]>max)
  19. {
  20. a[i]=max;
  21. }
  22.  
  23. else if(a[i]<min)
  24. {
  25. a[i]=min;
  26. }
  27.  
  28. }
  29. printf("%d %d", max,min);
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement