直接乘,不用再倒数变幻,于是直接累加即可,1个循环 摘要:解题思路:1.由于直接乘,不用再倒数变幻,于是直接累加即可,1个循环。2.因为1,每次累乘后,无需更新,直接继续,累加即可。3.用pow不稳定?注意:这类题最后结果sum+1。参考代码:#includ…… 题解列表 2024年12月07日 1 点赞 0 评论 206 浏览 评分:0.0
1723: 求最大值 超级简单做法 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){ // 定义一个长度为10的整型数组a …… 题解列表 2024年12月07日 0 点赞 0 评论 207 浏览 评分:0.0
蓝桥杯基础练习VIP-Huffuman树C++ 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;#include<algorithm>int main(){ int n,pay=0; …… 题解列表 2024年12月07日 1 点赞 0 评论 322 浏览 评分:0.0
检验每个数位上的值并计数:临时变量、while属性,进位位置区分 摘要:解题思路:1.检验每个数位上的值并计数:while;%10求模;count++;/10更新。2.临时变量:转换for与while循环的区分属性:while会从0-n全部循环一遍,只用1次,内部/10迭…… 题解列表 2024年12月07日 0 点赞 0 评论 207 浏览 评分:0.0
1725: 统计字符 超简单做法 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){ // 定义两个字符串变量s1和s2 …… 题解列表 2024年12月07日 0 点赞 0 评论 204 浏览 评分:0.0
C语言训练-排序问题(2)C++使用sort排序 摘要:解题思路:自定义cmp,使sort()为降序函数注意事项:参考代码:#include<iostream>using namespace std;#include<algorithm>bool cmp(…… 题解列表 2024年12月07日 1 点赞 0 评论 344 浏览 评分:0.0
普普通通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int sum(int n){ int sum = 0; for(int i = 1; i < n; i++) if(…… 题解列表 2024年12月07日 0 点赞 0 评论 436 浏览 评分:0.0
蓝桥杯算法提高-快速排序C++ 摘要:解题思路:使用快速排序标准解答注意事项:参考代码:#include<iostream>using namespace std;const int MAX=1e5+10;int a[MAX];int p…… 题解列表 2024年12月07日 0 点赞 0 评论 246 浏览 评分:0.0
1123: C语言训练-列出最简真分数序列* 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i; for(i = 1;i<40;i++) if (i == 1) { printf(…… 题解列表 2024年12月08日 0 点赞 0 评论 338 浏览 评分:0.0
C语言 两个数组+3个for循环解决问题 摘要:解题思路: 用 数组b 的下标记录,我们输入的 数组a 的各个值出现的次数例如 a[6]={ 5, 2, 3, 2, 2, 5 } ;因为 数组a 的最大值是5 ,所以 数组b 的下标最大值也是5那…… 题解列表 2024年12月08日 0 点赞 0 评论 258 浏览 评分:0.0