#include<iostream>
using namespace std;
void f(int y[], int o)
{
for (int q = 1; q <= o; y++)
{
cout << y[q];
}
}
void main()
{
int b, m, c, a[20], k, i, n, u, p;
cin >> n;
k = n;
i = 1;
b = 0;
m = 1;
p = 0;
u = 0;
while (1)
{
c = 0;
while (m)
{
b = k % 10;
m = k / 10;
c = c + b ^ 2;
}
a[i] = c;
i++;
p = i++;
if (c == 1)
{
cout << n << "是一个Happy Number" << "其中的数有";
f(a, i);
break;
}
if (c == 4) u++;
if (u == 2)
{
for (int g = 1; g <= p / 2; g++)
{
if (a[g] == a[p - g])
{
cout << n << "不是Happy Number" << "重复前的数有";
f(a, p - g);
break;
}
}
}
}
}
using namespace std;
void f(int y[], int o)
{
for (int q = 1; q <= o; y++)
{
cout << y[q];
}
}
void main()
{
int b, m, c, a[20], k, i, n, u, p;
cin >> n;
k = n;
i = 1;
b = 0;
m = 1;
p = 0;
u = 0;
while (1)
{
c = 0;
while (m)
{
b = k % 10;
m = k / 10;
c = c + b ^ 2;
}
a[i] = c;
i++;
p = i++;
if (c == 1)
{
cout << n << "是一个Happy Number" << "其中的数有";
f(a, i);
break;
}
if (c == 4) u++;
if (u == 2)
{
for (int g = 1; g <= p / 2; g++)
{
if (a[g] == a[p - g])
{
cout << n << "不是Happy Number" << "重复前的数有";
f(a, p - g);
break;
}
}
}
}
}