#include<stdio.h>
main()
{
long int j,c;
scanf("%ld",&c);
for(j=1;j<=c;j++)
{
long int a,b,sum=0,h=0,c,i;
scanf("%ld",&a);
b=a;
while(b!=sum)
{
//printf("%ld %ld\n",b,sum);
sum=0;
while(a!=0)
{
i=a%10;
a=a/10;
sum=(sum*10)+i;
}
//h++;
if(b!=sum)
{
c=b+sum;
//printf("%ld %ld\n",b,sum);
a=c;
b=a;
}
h++;
//printf("%ld\n",h);
}
printf("%ld %ld\n",h-1,b);
}
}
main()
{
long int j,c;
scanf("%ld",&c);
for(j=1;j<=c;j++)
{
long int a,b,sum=0,h=0,c,i;
scanf("%ld",&a);
b=a;
while(b!=sum)
{
//printf("%ld %ld\n",b,sum);
sum=0;
while(a!=0)
{
i=a%10;
a=a/10;
sum=(sum*10)+i;
}
//h++;
if(b!=sum)
{
c=b+sum;
//printf("%ld %ld\n",b,sum);
a=c;
b=a;
}
h++;
//printf("%ld\n",h);
}
printf("%ld %ld\n",h-1,b);
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন