**你是不是也错了33%!?** 摘要::sweat_smile:杭电题的细节要求绝对是top,***注意题目上并没有说i>j。错33%就在这错着。*** ```cpp #include using namespace std; t…… 题解列表 2019年10月21日 0 点赞 0 评论 1246 浏览 评分:6.0
The 3n + 1 problem -题解(C语言代码) 我是看了评论才注意到i,j输出的问题。但是我还有一个问题,输入1和1000000就得不到答案了,还想请教各位大佬。```c#includeintfun(intm){if(m==1)return4;inta=0,b=0;while(m!=1){if(m%2==0){m=m/2;a++;}else{m=m 题解列表 2019年10月28日 0 点赞 0 评论 606 浏览 评分:0.0
The 3n + 1 problem -题解(C语言代码) 本题,我想最坑的地方就是那个比较两个输入数之间的大小了吧,而且还要以原顺序输出,所以一定要注意,不能只考虑到输如110,输出11020,如果输入101的情况,也要输出10120哦!下面呢,还是老样子,给出比较简洁的代码:```c#includeintmain(){longintt, 题解列表 2019年11月07日 0 点赞 1 评论 1873 浏览 评分:9.9
The 3n + 1 problem -题解(Java代码) ```javaimportjava.util.Scanner;/***The3n+1problem*http://www.dotcpp.com/oj/problem1095.html*题目描述:*考虑下面的算法来生成一个数字序列。*以整数n开始。 题解列表 2019年11月14日 0 点赞 0 评论 937 浏览 评分:0.0
The 3n + 1 problem -题解(C语言代码) 首先,因为这个题目是英文的,所以容我多说几句关于题目的讲解~这道题的意思就是输入两个数[i,j],区间内的每个数字,都要进行一系列运算:如果这个数字是偶数,则除以2,如果这个数字是奇数,则乘以3在加1,直到这个数最终被除为1。这些经过运算产生的数, 题解列表 2019年11月21日 0 点赞 1 评论 1061 浏览 评分:9.5
The 3n + 1 problem (C++代码) ```cpp#includeusingnamespacestd;intmain(){intx=1,i,j,t,m=0,k=0,f;while(x==1){cin>>i>>j;for(t=i;t 题解列表 2019年12月05日 0 点赞 2 评论 943 浏览 评分:9.0 The 3n + 1 problem -题解(C语言代码)答案错误%33的同学请进 解题思路:首先自己已经二刷,又遇到了一些坑,在此总结思考一下先找思路,就是简单的判断偶数除2,奇数*3+1注意事项:考虑以下几个方面:1:给的i,j值可能不是按从小到大的顺序2:中间变量temp可能在计算temp=temp*3+1的过程中超int范围[详细解题思路(老师讲解)](https://mp. 题解列表 2019年12月11日 0 点赞 6 评论 1485 浏览 评分:9.3 The 3n + 1 problem -题解(C++代码) #include#include#includeusingnamespacestd;intmain(){intn1,n2,i,j,sum,max=0;//max为最大循环长度,sum为每位数字的循环长度,while(~scanf("%d%d",&n1,&n2)){cout 题解列表 2019年12月12日 0 点赞 0 评论 1057 浏览 评分:8.0 The 3n + 1 problem -题解(C语言代码) 摘要:## 常规解法,只需要将数字转为Ascii码,A的为65. ```c #include int cmp(int n){ if (n==1){ printf("A"); }else…… 题解列表 2019年12月20日 0 点赞 0 评论 903 浏览 评分:0.0 The 3n + 1 problem -题解(C语言代码) 摘要:```c #include int main() { int n,m; int a,b; while(scanf("%d%d",&n,&m)!=EOF) // 题意是输入俩个…… 题解列表 2019年12月22日 0 点赞 0 评论 829 浏览 评分:0.0 « 12345678...1415 »
The 3n + 1 problem -题解(C语言代码)答案错误%33的同学请进 解题思路:首先自己已经二刷,又遇到了一些坑,在此总结思考一下先找思路,就是简单的判断偶数除2,奇数*3+1注意事项:考虑以下几个方面:1:给的i,j值可能不是按从小到大的顺序2:中间变量temp可能在计算temp=temp*3+1的过程中超int范围[详细解题思路(老师讲解)](https://mp. 题解列表 2019年12月11日 0 点赞 6 评论 1485 浏览 评分:9.3
The 3n + 1 problem -题解(C++代码) #include#include#includeusingnamespacestd;intmain(){intn1,n2,i,j,sum,max=0;//max为最大循环长度,sum为每位数字的循环长度,while(~scanf("%d%d",&n1,&n2)){cout 题解列表 2019年12月12日 0 点赞 0 评论 1057 浏览 评分:8.0
The 3n + 1 problem -题解(C语言代码) 摘要:## 常规解法,只需要将数字转为Ascii码,A的为65. ```c #include int cmp(int n){ if (n==1){ printf("A"); }else…… 题解列表 2019年12月20日 0 点赞 0 评论 903 浏览 评分:0.0
The 3n + 1 problem -题解(C语言代码) 摘要:```c #include int main() { int n,m; int a,b; while(scanf("%d%d",&n,&m)!=EOF) // 题意是输入俩个…… 题解列表 2019年12月22日 0 点赞 0 评论 829 浏览 评分:0.0