https://www.acmicpc.net/problem/1110
#include<stdio.h>
#include <string.h>
#include <stdlib.h>
static int change(int n){
int a=n/10;
int b=n%10;
int c=a+b;
return b*10+c%10;
}
int main() {
int n;
scanf("%d",&n);
int t=1;
int num=change(n);
if(n==0) printf("1");
else{
while(1){
num=change(num);
t++;
if(num==n){
printf("%d",t);
break;
}
}
}
}