1 条题解

  • 1
    @ 2023-12-18 22:30:03
    ```#include<iostream>
    using namespace std;
    int main(){
    	int n,num = 0;
    	cin >> n;
    	do{
    		if(n%2 == 0){
    			n = n/2;
    		}
    		else{
    			n = 3*n + 1;
    		}
    		num += 1;
    	}while(n != 1);
    	cout << num;
    	return 0;
    }
    
    • 1

    信息

    ID
    36
    时间
    1000ms
    内存
    16MiB
    难度
    6
    标签
    递交数
    22
    已通过
    11
    上传者