---
# System prepended metadata

title: Java_Cmoney_ot0007
tags: [Cmoney_Java題目]

---

---
tags: Cmoney_Java題目
---
Java_Cmoney_ot0007
===

![](https://i.imgur.com/oyj52Cm.png)
![](https://i.imgur.com/TNgBsUT.png)





1.主程式
---
美妙的陣列排序 function
`Arrays.sort(Object[]);`

```java=
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            int m = sc.nextInt();
            int[] numbers = new int[m];
            for (int j = 0; j < m; j++) {
                numbers[j] = sc.nextInt();
            }
            Arrays.sort(numbers);
            System.out.println(numbers[m-1]);
        }
    }
}
```