Advertisement
aunkang

ข้อ2

Nov 24th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2.   int main()
  3. {
  4.       int n,x,i,min=32000,max=-32000;
  5.     scanf("%d",&n);
  6.     for(i=1;i<=n;i++)
  7.     {
  8.         scanf("%d",&x);
  9.         if(x < max)
  10.         {min = x;}
  11.         if(x > min)
  12.         {max = x;}
  13.     }
  14.     printf("%d",max);
  15.     printf("%d",min);
  16.   return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement