http://acm.hdu.edu.cn/showproblem.php?pid=2107
代码:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int main() {
    int n;
    while(~scanf("%d", &n)) {
        if(n == 0) break;
        for(int i = 1; i <= n; i ++)
            scanf("%d", &a[i]);
        sort(a + 1, a + 1 + n);
        printf("%d\n", a[n]);
    }
    return 0;
}
原文:https://www.cnblogs.com/zlrrrr/p/9410875.html