2012-04-06 AOJ 0158 - Collatz's Problem aoj Vimで書いてみた. でも,ヤンクしてもクリップボードに反映されなかった. #include <iostream> int main(){ int n; while(std::cin >> n, n){ int t = 0; while(n != 1){ if(n % 2)n = n * 3 + 1; else n /= 2; t++; } std::cout << t << std::endl; } }