0分求调
查看原帖
0分求调
1562334
junjie141319楼主2025/1/24 16:26

#include

#include<iostream>
using namespace std;
int main() {
int n;
cin >> n;
while(n != 1){
if(n%2 == 0){
    n = n/2;
}else {
    n = 3*n+1;
}
cout << n << "";
}
return 0;
}

#include using namespace std; int main() { int n; cin >> n; while(n != 1){ if(n%2 == 0){ n = n/2; }else { n = 3*n+1; } cout << n << ""; } return 0; }

2025/1/24 16:26
加载中...