Description
Input
输入的第一行是一个整数M(1=<M<=100),后面有M个测试样例。每个测试样例以一个整数N开始,后面接着是N个整数(1=<N<=100)。
Output
每组测试样例对应一行输出,为所给的N个整数中的最大的数和最小的数,顺序与输入对应。
Sample Input
2 5 2 3 1 4 5 10 18 19 14 15 11 20 13 12 16 17
Sample Output
1 5 11 20
HINT
Append Code
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int a,b,m,max=0,min=100;
scanf("%d",&a);
for(int i=0;i<a;i++)
{
scanf("%d",&b);
for(int j=0;j<b;j++)
{
scanf("%d",&m);
if(m>max) max=m;
if(m<min) min=m;
}
printf("%d %d\n",min,max);
min=100;
max=0;
}
return 0;
}