blob: cdc34ab506cc16d4b02a776d626aa06f4c987b43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <iostream>
int main() {
int n;
std::cin >> n;
int k = 0;
while (n != 1) {
n = n % 2 ? n * 3 + 1 : n / 2;
k++;
}
std::cout << k << std::endl;
return 0;
}
|