题解 1095: The 3n + 1 problem

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

答案不管怎么改都错误33%的同学看过来! (C++代码)

摘要:解题思路:明明写的很对,可就是错误33%,查了两小时的资料,终于知道问题出在哪里了!注意事项:输入i,j时,并不知道大小情况,所以输入后需要比较一次,但是输出时,如果在最后输出,那可能输出的是比较大小……

The 3n + 1 problem (C++代码)

摘要:解题思路:注意事项: 输入的i不一定比j小参考代码:#include<iostream>using namespace std;int main(){ int i,j; while(cin>>i>>j……

The 3n + 1 problem (C++代码)

摘要:解题思路:将每一个区间内的数进行运算,找出其中循环次数最多的那一个注意事项:/*1 41 4 84 14 1 85 15 1 86 16 1 9 7 17 1 17*/先后输入的俩个数需要比大小让小的……

The 3n + 1 problem (C++代码)

摘要:解题思路:就是扫雷游戏规则注意事项:一定要注意格式,一定,一定!!!!!参考代码:#include<iostream>#include<cstdio>using namespace std;int a……

The 3n + 1 problem (C++代码)

摘要:解题思路:这个问题其实很简单,无非就是先把输入的数据先存储起来,在对每组数据进行一个找最大周期长度的过程,存储的话我用的是vector,找最大周期长度写一个while循环注意事项:1、算最大周期长度要……

The 3n + 1 problem (C++代码)

摘要:数字本身也正在运行次数类,所以最后的max要加1每次循环结束记得要k归0,最大值也要归零#include<iostream>using namespace std;int main() { long ……

The 3n + 1 problem (C++代码)

摘要:解题思路:求最大循环长度注意事项:参考代码:#include <iostream>#include <cstdio>using namespace std;int main(){int m,n;whi……

The 3n + 1 problem (C++代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>#include<algorithm>#include<math.h>using namespace……