#include<stdio.h>
int main()
{
    int count = 0;
    int n;
    scanf("%d",&n);
    while(n>1)
    {
        if(n%2==1) n=n*3+1;
        else 
        n/=2;
        count++;
    }
    printf("%d\n",count);
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2022-01-11
  • 2021-05-16
相关资源
相似解决方案