简单的循环判断语句嵌套 解题思路:对于输入的一个整数n,是偶数就/2,是奇数就*3再+1.每一个操作对应一句输出,别忘了换行。当n=1时循环终止注意事项:参考代码:#define_CRT_SECURE_NO_WARNINGS1#includeintmain(){intn;scanf("%d", 题解列表 2026年07月22日 0 点赞 0 评论 122 浏览 评分:0.0
1147:角谷猜想 摘要:解题思路:注意事项:参考代码: 方法一:#include<stdio.h>int main(){ int num; scanf("%d&quo…… 题解列表 2025年11月04日 1 点赞 0 评论 457 浏览 评分:10.0
1147 角谷猜想 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int ou(int x){ x /= 2; return x;}int…… 题解列表 2025年08月14日 0 点赞 0 评论 376 浏览 评分:0.0
2025/7/31刷题记录 摘要:解题思路:注意事项:递归要满足有明显的结束条件 有要趋于结束条件的趋势参考代码:#include<stdio.h>void avgerage(int num){ …… 题解列表 2025年07月31日 0 点赞 0 评论 313 浏览 评分:0.0
1147: C语言训练-角谷猜想 摘要:解题思路:注意事项:printf写在式子前。参考代码:#include<stdio.h>#include<math.h> int main(){ int a; scanf("%d",&a); for …… 题解列表 2024年12月08日 0 点赞 0 评论 723 浏览 评分:0.0
最普通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a; scanf("%d",&a); while(a!=1) { …… 题解列表 2024年11月18日 0 点赞 0 评论 478 浏览 评分:0.0
关于函数的简单写法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int fun (int n ){ int c ; scanf( "%d",&n ) ; if ( n%2==0…… 题解列表 2024年11月08日 0 点赞 0 评论 458 浏览 评分:0.0
c语言代码题解 摘要:```c #include int main() { int n; scanf("%d", &n); while (n != 1) {// 当n不等于1时,继续…… 题解列表 2024年08月21日 0 点赞 0 评论 579 浏览 评分:0.0
模块化(自定义函数)验证角谷猜想 解题思路:角谷猜想:任给一个自然数,若为偶数除以2,若为奇数则乘3加1,得到一个新的自然数后按照上面的法则继续演算,若干次后得到的结果必然为1。从这句话可以看出,只有当新的自然数为1时,才会停止循环。而在循环中,需要判断这个自然数是奇数还是偶数。 题解列表 2024年08月01日 0 点赞 0 评论 584 浏览 评分:0.0
C语言训练-角谷猜想 摘要:解题思路:注意事项:参考代码:n = int(input())while n != 1: if n%2 == 0: print(f"{int(n)}/2={int(n/2)}") …… 题解列表 2024年07月30日 0 点赞 0 评论 733 浏览 评分:0.0