ans

DOZIE 2022-08-14 21:24:38 6 返回题目

#include <bits/stdc++.h> using namespace std; int main(){ int n , x = 0; cin >> n; while (n > 1){ if (n % 2 == 0){ n = n / 2; x = x + 1; } else { n = n * 3 + 1; x = x + 1; } } cout << x; return 0; }

{{ vote && vote.total.up }}