题解 | #xxx定律#
xxx定律
http://www.nowcoder.com/practice/75c189249d6145cfa33cd53edae6afc8
int main(){
int a ;
while (scanf("%d", &a) != EOF) {
int count = 0;
if (a == 0){
return 0;
}
while (a != 1){
if(a % 2 == 0){
a /= 2;
} else {
a = (a * 3 + 1) / 2;
}
count ++;
}
printf("%d\n", count);
}
}