#include <stdio.h>
#include <stdlib.h>
main()
{
	int x,n=0;
	printf("请输入:");
	scanf("%d",&x);
	for(n=0;x!=1;n++){
		if(x%2==1)
		{
			x=(3*x+1)/2;
		}
		else
		{
			x=x/2;
		}
	}
	printf("输出:%d",n);
	return 0;
} 
c++上这个程序可以运行,那为什么下面的这个程序就不能运行了呢?直接运行结束了。
#include <stdio.h>
#include <stdlib.h>
main()
{
	int x,n=0;
	scanf("%d",&x);
	for(n=0;x!=1;n++){
		if(x%2==1)
		{
			x=(3*x+1)/2;
		}
		else
		{
			x=x/2;
		}
	}
	printf("%d",n);
	return 0;
}