直接乘,不用再倒数变幻,于是直接累加即可,1个循环 解题思路:1.由于直接乘,不用再倒数变幻,于是直接累加即可,1个循环。2.因为1,每次累乘后,无需更新,直接继续,累加即可。3.用pow不稳定?注意:这类题最后结果sum+1。参考代码:#include#includeusingnamespacestd;intmain 题解列表 2024年12月07日 1 点赞 0 评论 511 浏览 评分:0.0
编写题解 1073: 弟弟的作业 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h> //atio函数,将字符串转换为数字.#include<string.h> …… 题解列表 2024年12月07日 4 点赞 0 评论 1050 浏览 评分:10.0
蓝桥杯2024年第十五届省赛真题-好数 #includeintmain(){intn;intd=0;;intu=1;intc=0;inti=0;scanf("%d",&n);for(inta=1;a10;){d/=10;u++;//u统计位数}d=a;for(intw=1;w 题解列表 2024年12月07日 1 点赞 0 评论 935 浏览 评分:10.0
1033: [编程入门]自定义函数之字符提取 #includeintmain(){chara[1000];chars[1000];gets(a);inty=0;intr=0;while(a[y]!='\0'){if((a[y]=='a')||(a[y]=='e')||(a[y]=='i')||(a[y]=='o')||a[y]=='u'){s[r 题解列表 2024年12月07日 1 点赞 0 评论 1086 浏览 评分:10.0
1723: 求最大值 超级简单做法 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){ // 定义一个长度为10的整型数组a …… 题解列表 2024年12月07日 0 点赞 0 评论 493 浏览 评分:0.0
蓝桥杯基础练习VIP-Huffuman树C++ 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;#include<algorithm>int main(){ int n,pay=0; …… 题解列表 2024年12月07日 1 点赞 0 评论 580 浏览 评分:0.0
检验每个数位上的值并计数:临时变量、while属性,进位位置区分 解题思路:1.检验每个数位上的值并计数:while;%10求模;count++;/10更新。2.临时变量:转换for与while循环的区分属性:while会从0-n全部循环一遍,只用1次,内部/10迭代;for是会分次,每次带入分情况。3./10的位置:注意区分, 题解列表 2024年12月07日 0 点赞 0 评论 489 浏览 评分:0.0
一个简单的自定义函数 来处理 素数 摘要:解题思路:试除法判断scanf输入的数 是or不是素数注意事项:循环的优化参考代码:#include <stdio.h>#include <math.h>int is_Prime(int a){ in…… 题解列表 2024年12月07日 1 点赞 0 评论 1541 浏览 评分:10.0
1725: 统计字符 超简单做法 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){ // 定义两个字符串变量s1和s2 …… 题解列表 2024年12月07日 0 点赞 0 评论 424 浏览 评分:0.0
C语言训练-排序问题(2)C++使用sort排序 摘要:解题思路:自定义cmp,使sort()为降序函数注意事项:参考代码:#include<iostream>using namespace std;#include<algorithm>bool cmp(…… 题解列表 2024年12月07日 1 点赞 0 评论 684 浏览 评分:0.0