96 条题解

  • 1

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 1

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0
    @ 2022-08-25 12:50:58
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        while(n!=1)
        {
            if(n%2==0)
                {
                    cout<<n<<"/"<<2<<"="<<n/2<<endl;
                    n/=2;
                }
            else
            {
                cout<<n<<"*"<<3<<"+"<<1<<"="<<n*3+1<<endl;
                n=3*n+1;
            }
        }
        cout<<"End";
        return 0;
    }
    
  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    v

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    v

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

  • 0

    #include<iostream>
    using namespace std;
    int main()
    {
    int N;
    cin>>N;
    if(N==1)
    cout<<"End";
    else
    while(N>1)
    {
    if(N%2==0)
    {
    cout<<N<<'/'<<2<<'='<<N/2<<endl;
    N=N/2;
    }
    else
    if(N%2!=0)
    {
    cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
    N=N*3+1;
    }
    }
    cout<<"End";
    }

信息

ID
1748
难度
2
分类
(无)
标签
递交数
80
已通过
44
通过率
55%
被复制
2
上传者