#include<stdio.h> int main(){ int n,i; scanf("%d",&n); i=0; for(;n!=1;){ if(n%2==0){ n=n/2; i=i+1; } else{ n=n*3+1; i=i+1; } } printf("%d",i); return 0; }
for循环的迭代条件可以这样用
标签:角谷,return,int,定理,n%,main From: https://www.cnblogs.com/LXYlxy666/p/16861560.html