题解 | #兔子的序列#
兔子的序列
https://www.nowcoder.com/practice/55fc2ebad3fd444bbb1754ba1b259762
#include <iostream> #include<cmath> using namespace std; int main() { int a[1001],n,max=0; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { if((int)sqrt(a[i])*(int)sqrt(a[i])!=a[i]) { if(max<a[i]) max=a[i]; } } cout<<max; return 0; }