编辑代码

import java.util.Scanner;
class Main {
	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);
        }
	}
}