2 条题解

  • 0
    @ 2025-3-23 8:46:09
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
        cin>>n;
        while(n!=1){
            if(n%2){
                cout<<n<<"*3+1="<<n*3+1<<endl;
                n=n*3+1;
            }else{
                cout<<n<<"/2="<<n/2<<endl;
                n=n/2;
            }
        }
    return 0;
     }
    

    信息

    ID
    168
    时间
    1000ms
    内存
    128MiB
    难度
    3
    标签
    递交数
    199
    已通过
    70
    上传者