#include <iostream>
#include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
string check; cin >> check;
string cycle;
int cnt = 0;
if (check.length() == 1) {
check = "0" + check;
}
cycle = check;
while (true) {
int temp = stoi(cycle) / 10 + stoi(cycle) % 10;
int temp3 = stoi(cycle) % 10;
cycle = to_string(temp3) + to_string(temp % 10);
if (check == cycle) break;
else cnt++;
}
cout << cnt + 1;
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 11286๋ฒ - ์ ๋๊ฐ ํ (0) | 2021.10.27 |
---|---|
[๋ฐฑ์ค,c++] 11279๋ฒ - ์ต๋ ํ (0) | 2021.10.27 |
[๋ฐฑ์ค,c++] 11123๋ฒ - ์ ํ๋ง๋ฆฌ... ์ ๋๋ง๋ฆฌ... (0) | 2021.10.27 |
[๋ฐฑ์ค,c++] 1107๋ฒ - ๋ฆฌ๋ชจ์ปจ (0) | 2021.10.27 |
[๋ฐฑ์ค,c++] 11053๋ฒ - ๊ฐ์ฅ ๊ธด ์ฆ๊ฐํ๋ ๋ถ๋ถ ์์ด(Longest Increasing Subsequence,Lis) (0) | 2021.10.27 |
[๋ฐฑ์ค,c++] 11052๋ฒ - ์นด๋ ๊ตฌ๋งคํ๊ธฐ (0) | 2021.10.27 |
๋๊ธ