Pat乙级1001

/*
  按照题目要求来就行
*/
import java.util.Scanner;

public class Main {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int steep = 0;
while(n != 1){
++ steep;
n = n % 2 == 0 ? n /2 : (3 * n + 1) / 2;
}
System.out.println(steep);
}

}
上一篇:plt.show()和 plt.imshow()


下一篇:[CF1523F] Favorite Game