include
using namespace std;
int odwroc(int a)
{
int j, d;
j=a%10;
d=(a-j)/10;
int k=j*10;
return (k+d);
}
void spr(int p)
{ int timer=0;
int n = p;
int j = odwroc(p);
bool t = false;
while(t!=true) {
if(n-j==0) {cout<<n<<" "<<timer<<endl;
t=true;}
else
{ n+=j;
j=odwroc(j);
timer++;}
}
}
int main() {
int n,p;
cin>>n;
for(int x=0; x<n; x++)
{cin>>p;
spr(p);
}
return 0;
}
Gdzie moze byc blad?