subtask2为啥不对啊

B2077 角谷猜想

Q612Asteroid @ 2024-11-15 21:24:43

https://www.luogu.com.cn/record/188966104 https://www.luogu.com.cn/record/188966494 什么唐龙题???


by black_white_cat @ 2024-11-15 21:40:08

!=1改为>1会好一些吧


by SYX0IAI @ 2024-11-15 21:46:15

#include<iostream>
using namespace std;
int main(){
    long long a,b;
    cin>>a;
    if(a!=1){
        for(;a!=1;){
        if(a%2==0){
            b=a/2;
            cout<<a<<"/2="<<b<<endl;
        }
        else{
            b=a*3+1;
            cout<<a<<"*3+1="<<b<<endl;
        }
        a=b;
    }
    }

    cout<<"End";
}
//(注:10岁小孩写的)

|