检验每个数位上的值并计数:临时变量、while属性,进位位置区分 摘要:解题思路:1.检验每个数位上的值并计数:while;%10求模;count++;/10更新。2.临时变量:转换for与while循环的区分属性:while会从0-n全部循环一遍,只用1次,内部/10迭…… 题解列表 2024年12月07日 0 点赞 0 评论 164 浏览 评分:0.0
1725: 统计字符 超简单做法 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){ // 定义两个字符串变量s1和s2 …… 题解列表 2024年12月07日 0 点赞 0 评论 173 浏览 评分:0.0
C语言训练-排序问题(2)C++使用sort排序 摘要:解题思路:自定义cmp,使sort()为降序函数注意事项:参考代码:#include<iostream>using namespace std;#include<algorithm>bool cmp(…… 题解列表 2024年12月07日 1 点赞 0 评论 285 浏览 评分: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 评论 403 浏览 评分:0.0
蓝桥杯算法提高-快速排序C++ 摘要:解题思路:使用快速排序标准解答注意事项:参考代码:#include<iostream>using namespace std;const int MAX=1e5+10;int a[MAX];int p…… 题解列表 2024年12月07日 0 点赞 0 评论 175 浏览 评分: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 评论 281 浏览 评分:0.0
C语言 两个数组+3个for循环解决问题 摘要:解题思路: 用 数组b 的下标记录,我们输入的 数组a 的各个值出现的次数例如 a[6]={ 5, 2, 3, 2, 2, 5 } ;因为 数组a 的最大值是5 ,所以 数组b 的下标最大值也是5那…… 题解列表 2024年12月08日 0 点赞 0 评论 203 浏览 评分:0.0
有规律的数列求和c语言 摘要:参考代码:#include <stdio.h> long long fibonacci(int n); int main() { int N,i; double sum; long…… 题解列表 2024年12月08日 4 点赞 0 评论 1105 浏览 评分:0.0
简单的写完就行了 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h> int main(){ int i; for(i = 1000;i<=9999;i++) { …… 题解列表 2024年12月08日 0 点赞 0 评论 199 浏览 评分:0.0
自由下落的距离计算C语言 摘要:参考代码:#include <stdio.h> int main() { int M,N,i; double h,m; h=0,m=0; scanf("%d %d",&M,&N);…… 题解列表 2024年12月08日 3 点赞 0 评论 578 浏览 评分:0.0