main.cpp
396 Bytes
#include<iostream>
using namespace std;
int main() {
int temp, input, count, fNum, bNum;
fNum = bNum = temp = input = count = 0;
cin >> input;
temp = input;
while (temp != input || count == 0) {
count++;
fNum = temp / 10;
bNum = temp % 10;
temp = fNum + bNum;
if (temp < 10)
temp += bNum * 10;
else
temp = temp % 10 + bNum * 10;
}
cout << count << endl;
return 0;
}