```
static int kk =0;
bool isHappy(int n) {
if(30 ==kk)return false;
kk++;
int num1[10]={0 },i,j,k=1;
for(i=0 ; n/k!= 0 ;i++)
{
num1[i] = n/k%10;
k*=10;
printf("%d\n",num1[i]);
}
n=0;
for(j=0;j<i;j++)
{
n+=num1[j]*num1[j];
}
printf("%d\n",n);
if (n ==1)return true;
else
return isHappy(n);
}
```