Homework


This is a companion discussion topic for the original entry at https://toph.co/p/homework

/******************************************************************************

                          Online C++ Compiler.
           Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press “Run” button to compile and execute it.

*******************************************************************************/

#include
#include
using namespace std;

int main()
{
int i,j,k=0,m;
cin>>m;
if(m<50){
for(int l=0;l<m;l++){
cin>>j;
while(m>0){
i=sqrt(j);
i=i*i;
if(i==j){
cout<<k<<endl;
k=0;
break;
}
else if(i!=j){
j=j/10;
if(j==0){
k=-1;
cout<<k<<endl;
break;
}
k++;
}
}
}
}
return 0;
}
some one help me please