#include <stdio.h> int main() { int N, i; scanf("%d", &N); for(i=0; N!=1; i++){ if(N%2==0) N=N/2; else N=N*3+1; } printf("%d", i); return 0; }
To embed this project on your website, copy the following code and paste it into your website's HTML: