Problem Description
Enter a positive integer n, the maximum number of the input integer n, the number n of output
Entry
The first line n
second row number n
Export
The maximum number of
Sample input
10
1 2 3 4 5 6 7 8 9 10
Sample Output
10
AC Code
#include <iostream>
using namespace std;
int main()
{
int n;
int a[100];
int a_max = 0;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> a[i];
if(a[i] > a_max)
{
a_max = a[i];
}
}
cout << a_max<< endl;
return 0;
}