#include<iostream>#include<algorithm>usingnamespace std;intmain(){
string s;
cin >> s;int N =0;while(N <10){// st串和s串相加
string st = s;reverse(s.begin(), s.end());int r =0;// 反转后的如果和原来的相等 那么就是回文数bool f =(s == st);if(f){
cout << st <<" is a palindromic number.";break;}int len = s.size();
string a;// 模拟加法for(int i =0; i < len; i++){// 先得到两个数字的和int x =((s[i]-'0')+(st[i]-'0')+ r);// 把模方答案里
a.push_back((x %10)+'0');// r是进位,初始为0
r = x /10;}if(r !=0)
a.push_back(r +'0');// 注意a现在是反着的,要先反过去reverse(a.begin(), a.end());
cout << st <<" + "<< s <<" = "<< a << endl;
s = a;
N++;}if(N ==10)
cout <<"Not found in 10 iterations.";return0;}