题目原链接:
http://acm.hdu.edu.cn/showproblem.php?pid=2107
AC代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
#define INF 0x3f3f3f3f
int main()
{
int n;
while(1)
{
cin >> n;
if(n==0)
break;
int maxPower = -INF;
int input;
for(int i = 0;i < n;i++)
{
cin >> input;
maxPower = (maxPower>input)?maxPower:input;
}
cout << maxPower << endl;
}
return 0;
}