题目链接:http://ac.jobdu.com/problem.php?pid=1483
解题时间:2013/4/14
程序源码:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
int max,min,temp;
while(scanf("%d",&n)!=EOF)
{
scanf("%d",&temp);
max=min=temp;
n--;
while(n--)
{
scanf("%d",&temp);
max=max>=temp?max:temp;
min=min<=temp?min:temp;
}
printf("%d %d\n",max,min);
}
return 0;
}