C++实现(其实应该算c++吧,随便改改就是c了) 摘要:解题思路:输入一个n,循环n次注意事项:没啥好注意的吧参考代码:#include<iostream> using namespace std; int main() { int n,s;//n…… 题解列表 2021年11月18日 0 点赞 0 评论 586 浏览 评分:9.9
蓝桥杯2014年第五届真题-分糖果 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cstdio> using namespace std; int flag=0; int main(){ …… 题解列表 2021年11月18日 0 点赞 0 评论 652 浏览 评分:9.9
自定义函数//初次见面,望各路大神多多关照哟!!! 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<iomanip> //注意保留四位小数哦!!!所以头文件是这个。using namespace st…… 题解列表 2021年11月18日 0 点赞 0 评论 586 浏览 评分:8.0
排序(C语言自己的排序函数) #include#include//C语言自己的排序函数为qsort(),内部运用的是快速排序机制intcomp(constvoid*a,constvoid*b);intmain(){inta[3];for(inti=0;i<3;i++){scanf("%d", 题解列表 2021年11月18日 0 点赞 0 评论 717 浏览 评分:0.0
水仙数求和 摘要:解题思路:注意事项:参考代码:for i in range(100,1000): sn = 0 for j in str(i): j=int(j) sn += …… 题解列表 2021年11月18日 0 点赞 0 评论 498 浏览 评分:0.0
[编程入门]报数问题 解题思路:题目要我们遇到三就让他退出,那我们不妨定义一个数组,让其中n个数都等于1,然后我们便让他们按顺序相加,当加起来等于三=3时,我们就让当这个数组等于0,最后当数组的n个数加起来等于1时,就只有当前这个数等于1了,我们把他的位置输出出来就是他的号码了。 题解列表 2021年11月18日 0 点赞 0 评论 911 浏览 评分:9.9
蛇形矩阵(适合小白入门)简单运用数组和循环的知识(也可以用一维数组做) 解题思路:老思路了,找规律。由N控制行数,再由n,i控制列数j,再在每一行通过i和j控制数的大小。可能我这个方法比较烦,但应该好理解注意事项:先把每一行第一个数的大小表示出来参考代码:#includeusingnamespacestd;intmain(){intn=0;cin>>n 题解列表 2021年11月18日 0 点赞 0 评论 844 浏览 评分:9.9
最大公约数与最小公倍公倍数 C语言 摘要:解题思路:辗转相除法求出最小公约数,最小公倍数等于两数乘积/最小公约数。注意事项:参考代码:#include <stdio.h>int main(){ int x, y, a, b, x1, x2; …… 题解列表 2021年11月18日 0 点赞 0 评论 581 浏览 评分:0.0
蓝桥杯基础练习VIP-数的读法(c++) 摘要:解题思路:帮别人写的有注释,顺便发个题解,看代码应该就理解了。参考代码:#include<iostream> #include<string> using namespace std; int …… 题解列表 2021年11月18日 0 点赞 0 评论 657 浏览 评分:9.9
编写题解 1167: 矩阵(C++)暴力解题 摘要:解题思路:数组b储存每一层的移动数,上一层移动一圈,下一层+1,直到最后一层移动一圈注意事项:参考代码:#include <iostream> using namespace std; int …… 题解列表 2021年11月18日 0 点赞 0 评论 1234 浏览 评分:8.0