C++ 代码
#include<bits/stdc++.h>
using namespace std;
int main(){
long long T;
cin>>T;
vector<long long> vct(T+5);
for(int i=0;i<T;i++){
cin>>vct[i];
}
int max = -1000000;
for(int i=0;i<T;i++){
int count=0;
if(vct[i]>=0){
for(long long j=0;j<=vct[i];j++){
if(j*j==vct[i]){
count++;
break;
}
}
}else{
if(vct[i]>max){
max = vct[i];
}
}
if(!count){
if(vct[i]>max){
}
}
}
cout<<max;
return 0;
}