import java.util.Scanner;
public class Test {
public static void main(String[] args) {
int m; // 存放数据的组数
int n; // 存放数据的个数
Scanner scanner = new Scanner(System.in);
m = scanner.nextInt();
for (int i = 0; i < m; ++i) {
n = scanner.nextInt();
int x; // 存放输入的数据
int maxValue = Integer.MIN_VALUE; // 存放每组数据的最大值
for (int j = 0; j < n; ++j) {
x = scanner.nextInt();
if (x > maxValue)
maxValue = x;
}
System.out.println(maxValue);
}
}
} |
|