#include <stdio.h>
int main() {
int num;
int count = 0;
scanf("%d\n",&num);
while(num > 1){
if (num % 2 == 0){
num = num / 2;
count += 1;
}
else{
num = (3*num+1)/2;
count += 1;
}
}
printf("%d\n",count);
}
PAT(1001.害死人不偿命的(3n+1)猜想)
最新推荐文章于 2024-10-02 22:45:05 发布