Witam,
Nie mogę znaleźć błędy w moim programie.
Proszę o pomoc.
#include
#include
using namespace std;
int main()
{
int t, liczba, liczba2, ile= 0;
string tekst, tekst2;
cin>>t;
for(int i=0; i<t; i++)
{
cin>>tekst;
liczba= atoi(tekst.c_str());
for(int j=tekst.length()-1; j>=0; j--)
{
tekst2+= tekst[j];
}
liczba2= atoi(tekst2.c_str());
do{
if(liczba==liczba2) break;
else
{
ile++;
liczba+=liczba2;
tekst=to_string(liczba);
tekst2="";
}
} while(true);
cout<<liczba<<" "<<ile;
}
return 0;
}