Post History
Java (JDK), 150 bytes interface M{static void main(String[]a){int i=new java.util.Scanner(System.in).nextInt(),j=0;for(;i!=1;j++){i=i%2==1?i*3+1:i/2;}System.out.print(j);}} Try it online! Fr...
Answer
#1: Initial revision
# [Java (JDK)], 150 bytes <!-- language-all: lang-java --> interface M{static void main(String[]a){int i=new java.util.Scanner(System.in).nextInt(),j=0;for(;i!=1;j++){i=i%2==1?i*3+1:i/2;}System.out.print(j);}} [Try it online!][TIO-kuryha8n] From [my](https://codegolf.codidact.com/users/54114) [shortC](https://github.com/aaronryank/shortC) [answer](https://codegolf.codidact.com/posts/284185/284440#answer-284440). [Java (JDK)]: http://jdk.java.net/ [TIO-kuryha8n]: https://tio.run/##LY29DsIgEIBfBQcTsIqlbhLi7ODU0TiQlppDexh6rZqmz44M7t@Pt5Pd@faREiC52NnGscs8kCVo2BSgZb0F5DVFwPv1ZsWcOQYG3Zv57MqR4CnrxiK6yOvvQK6XgEKi@9AZiYutN6XuQuQaVkZpXxS5YWBdGaNOsDkU6gj7Si9/N4wkX3lG3Au9LCmp8gc "Java (JDK) – Try It Online"