1095: The 3n + 1 problem java代码, 以及hasNext与hasNextLine的大致区别 摘要:```java import java.util.Scanner; public class Main { public static void main(String[] args) { …… 题解列表 2022年02月26日 0 点赞 0 评论 270 浏览 评分:0.0
求问大佬,为啥时间超限了 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main() { long int i, a, b, t; int c = 0, max = 0; int m = 0, k;…… 题解列表 2022年03月01日 0 点赞 2 评论 124 浏览 评分:0.0
纯纯小白做题家-直接上代码 摘要:解题思路://数组最大值问题(此问题中可以不用数组,只比较众多数地大小,取最大值),EOF问题//值得注意的是,输入的数据大小顺序不是一定的,并且对输出顺序没有要求,也就是说要按原输入顺序输出,但是在…… 题解列表 2022年03月25日 0 点赞 0 评论 187 浏览 评分:0.0
The 3n + 1 problem 摘要:解题思路:注意事项:参考代码:def f(x): c=1 while x!=1: if x%2==0: x=x//2 else: …… 题解列表 2022年04月24日 0 点赞 0 评论 190 浏览 评分:0.0
The 3n + 1 problem 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int x,y,max,a,b,rest; while(~scanf("%d %d",&a,&b)) { …… 题解列表 2022年04月30日 0 点赞 0 评论 266 浏览 评分:0.0
题解 1095: The 3n + 1 problem 关于超时 摘要:注意事项:关于超时,while(a!=1)我写成while(a>=1)就超时了,不太明白参考代码:#include<iostream> #include<string> using namespa…… 题解列表 2022年05月20日 0 点赞 0 评论 171 浏览 评分:0.0
小南解题--The 3n + 1 problem--118ms 摘要:def f(n): re=1 while n!=1: if n%2==0: n=n/2 else: n=n*3+1 …… 题解列表 2022年06月01日 0 点赞 0 评论 163 浏览 评分:0.0
个人思路,随便看看吧 摘要:解题思路:学会列表的相关操作很重要注意事项:参考代码:def fun(n): l1 = [n] while n != 1: if n % 2 == 0: …… 题解列表 2022年08月22日 0 点赞 0 评论 189 浏览 评分:0.0
python版小白易懂解法 摘要:解题思路:#循环长度,一个数按照一定的规则转换后成为1所需的“步骤数”#题目所求,输入x到输入y之间所有数的循环长度中最大的一个注意事项:输入的两数x,y的大小不确定参考代码:while True: …… 题解列表 2022年09月12日 0 点赞 0 评论 266 浏览 评分:0.0
1095: The 3n + 1 problem 摘要:解题思路:1. 循环次数:一个数按照一定的规则(即偶数除以2,奇数乘以3+1),转换后成为1所需的“步骤数”2. 题目目的:求输入x到输入y之间所有数的循环次数中最多的一个注意事项:我个人认为做这一题…… 题解列表 2022年10月12日 0 点赞 0 评论 175 浏览 评分:0.0