The 3n + 1 problem 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int prime(int a){ int c = 0; while (a != 1) { c++; if (a % 2…… 题解列表 2025年02月26日 0 点赞 0 评论 158 浏览 评分:0.0
注意审题有陷阱,花我那么多时间 摘要:解题思路:注意事项:有可能n>m,如果用for从n到m要换位置,而且输出的时候要注意以输入时的顺序输出参考代码:#include<stdio.h>#include<string…… 题解列表 2025年02月11日 0 点赞 0 评论 184 浏览 评分:0.0
会调用函数就可以 摘要:解题思路:注意事项:注意比较输入两个数的大小参考代码:#include <stdio.h>int c(int n) { int length = 1; // 初始…… 题解列表 2025年01月12日 1 点赞 0 评论 167 浏览 评分:0.0
这题的有问题 摘要:#include<stdio.h> int ans(int n); int main(void) { int to, from, temp; int i, j; i…… 题解列表 2024年12月29日 0 点赞 1 评论 238 浏览 评分:10.0
1095 3n+1(递归解决) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>long long digui(int n,long long m){ if(n==1)//如果是 1 ,就退出循环 { m+=1;…… 题解列表 2024年05月30日 0 点赞 0 评论 214 浏览 评分:0.0
The 3n + 1 problem 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include<math.h>int main(){ int a,b; int i = 0; int x; while (scan…… 题解列表 2024年03月05日 1 点赞 0 评论 223 浏览 评分:10.0
1095: The 3n + 1 problem 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int f(int n){ int i=1; while(n!=1) { if(n%2==0) n=n/2; else …… 题解列表 2023年11月03日 0 点赞 0 评论 155 浏览 评分:0.0
The 3n + 1 problem(乐,别忘了i和j的值要比下大小,再使用,还有如果i如果大于j的话,你交换了他们的值,但最终结果输出i和j必须是输入的i和j) 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { int a,b; while(~scanf("%d%d",&a,&b)) { i…… 题解列表 2023年10月04日 0 点赞 0 评论 114 浏览 评分:0.0
题解 1095: The 3n + 1 problem 摘要:解题思路:注意事项:还得先比较输入的两个数的大小!!!参考代码#include<stdio.h> int main() { int a,b,m,n,j,temp; int su…… 题解列表 2023年04月03日 0 点赞 0 评论 113 浏览 评分:0.0
The 3n + 1 problem(水题) 摘要:```c #include int fun(int n){ int cnt=0; do{ if(n%2==0){ n/=2; cnt++; } else…… 题解列表 2023年01月12日 0 点赞 0 评论 207 浏览 评分:9.9