Show life that you have a thousand reasons to smile
© Copyright 2024 DOKU.TIPS - All rights reserved.
#include<math.h>
int main()
{int n,i,ok=0;
float v[100];
cin>>n;
for(i=1;i<=n;i++)
cin>>v[i];
for(i=1;i<=n&&ok==0;i++)
if(sqrt(v[i])==int(sqrt(v[i])))
{ cout<<v[i];ok=1;}
ok=0;
for(i=n;i>=1&&ok!=3;i--)
if(sqrt(v[i])==int(sqrt(v[i])))
{ cout<<v[i];ok++;}
}