个人思路,随便看看吧 摘要:解题思路:学会列表的相关操作很重要注意事项:参考代码:def fun(n): l1 = [n] while n != 1: if n % 2 == 0: …… 题解列表 2022年08月22日 0 点赞 0 评论 408 浏览 评分:0.0
绝对值排序(C语言)冒牌排序进行排列 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int i,j,x,t; while(scanf("%d",&x)!…… 题解列表 2022年08月22日 0 点赞 0 评论 341 浏览 评分:0.0
[STL训练]Who's in the Middle:我看很多大佬都是用sort的,我来写一个使用STL中的multiset来实现的 摘要:解题思路:找到中间值注意事项:参考代码:#include<iostream> #include<set> using namespace std; int main(void) { …… 题解列表 2022年08月23日 0 点赞 0 评论 547 浏览 评分:0.0
2060: [STL训练]美国大选【我来使用STL算法中的multiset来写一份题解】 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<set>using namespace std;int main(void){ int i,temp; …… 题解列表 2022年08月23日 0 点赞 0 评论 968 浏览 评分:0.0
题解 1119: C语言训练-"水仙花数"问题1(C) 摘要:解题思路:本题在主函数中进行输入,水仙花判断函数中进行判断和输出。参考代码:#include<stdio.h> #include<math.h> void Narcissus(int num)…… 题解列表 2022年08月23日 0 点赞 0 评论 456 浏览 评分:0.0
题解 1120: C语言训练-"水仙花数"问题2(C) 摘要:解题思路:秋水仙花函数中求出水仙花数,并存储到数组中,通过指针将数据返回到主函数中,主函数进行输出。参考代码:#include<stdio.h> #include<math.h> int* N…… 题解列表 2022年08月23日 0 点赞 0 评论 397 浏览 评分:0.0
2061: [STL训练]周瑜的反间计(使用STL算法中的multiset来实现) 摘要:解题思路:注意事项:看到很多大佬都是使用set来写的,但是我觉得这道题没必要使用set,因为set相对于multiset,有输入中不能有重复元素的限制,导致set元素的插入有可能失败(仅仅代表个人看法…… 题解列表 2022年08月23日 0 点赞 0 评论 496 浏览 评分:0.0
2062: [STL训练]第二小整数(使用STL中的multiset) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<set>using namespace std;int main(void){ int i0,i,temp;…… 题解列表 2022年08月23日 0 点赞 0 评论 476 浏览 评分:0.0
1395: 倒数第二(STL multiset) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<set>using namespace std;int main(void){ int i0,i,temp;…… 题解列表 2022年08月23日 0 点赞 0 评论 678 浏览 评分:0.0
递归求最小公倍数和最大公约数 摘要:解题思路:利用辗转相除法求最大公约数,再利用最大公约数和最小公倍数的关系求最小公倍数注意事项:参考代码:#include<stdio.h>int gcd(int m,int n){ if(m%n…… 题解列表 2022年08月23日 0 点赞 0 评论 542 浏览 评分:0.0