#include<iostream>
using namespace std;
int main() {
int i,temp=0;
cin >> i;
while (i != 1) {
if (i % 2) {//jishu
i = (3 * i + 1) / 2;
temp++;
}
else {
i = i / 2;
temp++;
}
}
cout << temp << endl;
return 0;
}
PAT 1001
最新推荐文章于 2022-09-05 18:16:34 发布