文章
145
粉丝
218
获赞
293
访问
109.7k
#include <stdio.h> int main() { int n; while(scanf("%d",&n) != EOF) { if(n == 0) break; int count = 0; while(n != 1) { if(n % 2 == 0) n /= 2; else n = (3*n+1)/2; count++; } printf("%d\n",count); } return 0; }
登录后发布评论
暂无评论,来抢沙发