fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int n,count=0;
  6. n=30;
  7. while(n!=1){
  8. if(n%2==0)
  9. n=n/2;
  10. else n=3*n+1;
  11. count++;
  12. }
  13. printf("%d回 \n",count);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
18回