5 solutions

  • 0
    @ 2024-9-23 17:56:27

    #include<stdio.h> int main(){ long long n,t; scanf("%lld",&n); while(n!=1){ while(n%2==0){ printf("%lld/2=%lld\n",n,n/2); n/=2; } while(n%2!=0&&n!=1){ t=n; n=n3+1; printf("%lld3+1=%lld\n",t,n); } } printf("End"); return 0; }

    Information

    ID
    6752
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    8
    Tags
    (None)
    # Submissions
    380
    Accepted
    72
    Uploaded By