热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_49527298
坎坷的程序员
5 年前
trueweixin_49527298

哈哈,又来拉单杠了,我感觉我一个正规的都做不了

CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
// 奇偶归一计算最大数.cpp : Defines the entry point for the console application.//#include "stdafx.h"int main(int argc, char* argv[]){ int n,temp=1; printf("请输入任意正整数"); scanf("%d",&n); while(n!=1) { if(temp<n) { temp=n; } if(n%2==1) n=n*3+1; else n=n/2; printf("%d\n",n); } printf("最大数字为%d\n",temp); return 0;
立即登录