题解列表
2544:N以内累加求和(使用到for循环)
摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(int argc, char *argv[]) { int N,i; int sum=0; sca……
3010: 奇偶数之和(使用到for循环语句)
摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(int argc, char *argv[]) { int n,i; int sum1=0,sum2=0……
1072: 汽水瓶(简单易懂)
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n,sum; while (cin >> n) ……
C语言训练-排序问题(2)C++使用sort排序
摘要:解题思路:自定义cmp,使sort()为降序函数注意事项:参考代码:#include<iostream>using namespace std;#include<algorithm>bool cmp(……
1725: 统计字符 超简单做法
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"
using namespace std;
int main(){
// 定义两个字符串变量s1和s2
……
一个简单的自定义函数 来处理 素数
摘要:解题思路:试除法判断scanf输入的数 是or不是素数注意事项:循环的优化参考代码:#include <stdio.h>#include <math.h>int is_Prime(int a){ in……
检验每个数位上的值并计数:临时变量、while属性,进位位置区分
摘要:解题思路:1.检验每个数位上的值并计数:while;%10求模;count++;/10更新。2.临时变量:转换for与while循环的区分属性:while会从0-n全部循环一遍,只用1次,内部/10迭……
蓝桥杯基础练习VIP-Huffuman树C++
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;#include<algorithm>int main(){ int n,pay=0; ……
1723: 求最大值 超级简单做法
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"
using namespace std;
int main(){
// 定义一个长度为10的整型数组a
……