耗时18ms,好像有点高了,复杂度更达到了O(n^2).能不能更简单一点 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int num1(int n,int m){ if(n>m) swap(n,m…… 题解列表 2022年12月10日 0 点赞 1 评论 129 浏览 评分:9.9
1095: The 3n + 1 problem 摘要:```cpp #include #include using namespace std; int fun(int num) { int count=1; while(n…… 题解列表 2023年01月12日 0 点赞 0 评论 204 浏览 评分:9.9
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
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
这题的有问题 摘要:#include<stdio.h> int ans(int n); int main(void) { int to, from, temp; int i, j; i…… 题解列表 2024年12月29日 0 点赞 1 评论 239 浏览 评分:10.0