C语言:“小冰雹”

#include<stdio.h>
int main(){
int N;
printf("请输入一个大于0且小于10000的任意整数:");
scanf("%d",&N);
show:{
if((N%2)==0){
N=N/2;
}else{
N=N*3+1;
}
printf("%d\t",N);
if(N!=1){
goto show;
}
}
return 0;
}

猜你喜欢

转载自www.cnblogs.com/songminjie/p/10543871.html