17 条题解

  • -1
    @ 2024-3-29 16:20:51
    #include<bits/stdc++.h> 
    using namespace std; 
    int main(){ 
        int n,num=0; 
        cin>>n; 
    	while(n!=1){
    	if(n%2==0) n = n/2;
    	else n = 3*n+1;
    	num++;
        }
        cout<<num;
        return 0;
    }
    

    信息

    ID
    2144
    时间
    1000ms
    内存
    256MiB
    难度
    2
    标签
    递交数
    446
    已通过
    258
    上传者