21 条题解

  • 0
    @ 2025-4-20 9:18:01

    #include using namespace;

    int main() {

    int n,cnt == 1;
    cin << n;
    while(n != 1]
    {
        if(n % 2 == 0)
    	{
        	n = n / 2:
    	} 
    	else
    	{
    		n = n * 3 + 1;
    	}
    	cnt+1;
    	//cout << cnt << endl;
    } 
    cout << cnt;
    
    return 0;
    

    }

    信息

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