#include <iostream>
using namespace std;
int max( int arr[], int n ) {
int max = arr[0];
for (int i = 0; i < n; i++) {
if (max < arr[i]) {
max = arr[i];
}
}
return max;
}
int main() {
int n;
cout<<"Enter the number of students: ";
cin >> n;
int *arr = new int[n];
cout<<"Enter the grad of each student";
for(int i=0;i<n;i++){
cin>>arr[i];
}
cout<<"The highst grad is: "<<max(arr,n);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1heCggaW50IGFycltdLCBpbnQgbiApIHsKICAgIGludCBtYXggPSBhcnJbMF07CiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgIGlmIChtYXggPCBhcnJbaV0pIHsKICAgICAgICAgICAgbWF4ID0gYXJyW2ldOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiBtYXg7Cn0KaW50IG1haW4oKSB7CiAgICBpbnQgbjsKICAgIGNvdXQ8PCJFbnRlciB0aGUgbnVtYmVyIG9mIHN0dWRlbnRzOiAiOwogICAgY2luID4+IG47CiAgICBpbnQgKmFyciA9IG5ldyBpbnRbbl07CiAgICBjb3V0PDwiRW50ZXIgdGhlIGdyYWQgb2YgZWFjaCBzdHVkZW50IjsKICAgIGZvcihpbnQgaT0wO2k8bjtpKyspewogICAgCWNpbj4+YXJyW2ldOwogICAgfQogICAgY291dDw8IlRoZSBoaWdoc3QgZ3JhZCBpczogIjw8bWF4KGFycixuKTsKCXJldHVybiAwOwp9