1001 害死人不偿命的(3n+1)猜想

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <cstdio>
using namespace std;
int main() {
int n;
int count=0;
scanf("%d",&n);
while(n!=1){
if(n%2 == 0){
n /=2;
}else{
n = (3*n+1)/2;
}
count++;
}
printf("%d",count);
return 0;
}

1001 害死人不偿命的(3n+1)猜想
https://pisces34.github.io/2021/05/08/patB/basic-1001(3n+1)/
发布于
2021年5月8日
许可协议