借放程式碼,sort完之後輸出最後一位,恩恩
#include <iostream> //AC e465 f605 i399 k918 k900 k920 k921 d074
#include <vector>
#include <algorithm>
#define fast_as_a_fuckboy ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main(){
fast_as_a_fuckboy
int n;
cin >> n;
int a[n];
for(int i = 0;i < n;i++){
cin >> a[i];
}
sort(a, a+n);
cout << a[n-1];
}