Homework

Matthew has purchased a new game and isn’t feeling like completing his home work his teacher gave it…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

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

                          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