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";
    }

  • -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";
    }

  • -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";
    }

  • -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";
    }

  • -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";
    }

  • -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";
    }

  • -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";
    }V

  • -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>
     #include<stdio.h>
    using namespace std;
    int main()
    {
    int a,b;
    scanf("%d",&a);
       if (a ==1);
          while(a !=1)
               {
                    if (a%2 == 1)
                     {
                      b = a*3+1;
                      printf ("%d*3+1=%d\n",a,b);
                     a = b;
                     }
    
                    if (a%2 != 1)
                  {
                    b = a/2;
                printf ("%d/2=%d\n",a,b);
                    a = b;
                 }
                    if (a ==1)
                    break;
         }
     printf ("End\n");
     return 0;
     }
    
    

信息

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