#include<iostream>
using namespace std;
int main()
{
int n;
while(cin>>n&&n!=0&&n<=4){
int t;
int max=0;
for(int i=0;i<n;i++){
cin>>t;
if(t>max) max=t;
}
cout<<max<<endl;
}
return 0;
}
时间: 2024-11-08 23:09:14
#include<iostream>
using namespace std;
int main()
{
int n;
while(cin>>n&&n!=0&&n<=4){
int t;
int max=0;
for(int i=0;i<n;i++){
cin>>t;
if(t>max) max=t;
}
cout<<max<<endl;
}
return 0;
}