数据结构-图的遍历——DFS深度优先搜索 摘要:解题思路:用样例画出无向图,手动对图进行搜索,发现规律注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int Map[55][55];…… 题解列表 2022年03月28日 0 点赞 0 评论 985 浏览 评分:9.0
1059: 二级C语言-等差数列 解题思路:等差数列求和:Sn=a1*n+[n*(n-1)*d]/2或Sn=[n*(a1+an)]/2。注意事项:带了一句异常处理,检测到输入不合法的数(<1)会提示"n<1?"。参考代码://题目1058:二级C语言-求偶数和#includeusingnamespacestd;in 题解列表 2022年03月28日 0 点赞 0 评论 706 浏览 评分:7.0
1058: 二级C语言-求偶数和 摘要:解题思路:用while()接收连续输入,如果是偶数(模2为0)则加到结果上。注意事项:!val % 2 和 !(val % 2) 是两码事,牢记运算符优先级。参考代码:// 题目 1058: 二级C语…… 题解列表 2022年03月28日 0 点赞 0 评论 910 浏览 评分:9.9
1057: 二级C语言-分段函数 摘要:解题思路:老题重做,常看常新,警钟长鸣(无端)传送面板:https://blog.dotcpp.com/a/84235注意事项:和原题的区别是输出要保留两位小数。参考代码:// 题目 1057: 二级…… 题解列表 2022年03月28日 0 点赞 0 评论 721 浏览 评分:9.9
蓝桥杯算法提高VIP-质因数(简单循环解决) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool sushu(int n){for(int i=2;i<=(int)sqrt…… 题解列表 2022年03月28日 0 点赞 0 评论 519 浏览 评分:0.0
蓝桥杯算法提高VIP-邮票面值设计 ```cpp#include#include#includeusingnamespacestd;intn,k,ans;inta[15],dp[10005];//dp[i]表示凑到邮资值为i,最少需要多少张inttemp[15];voidDp(){intt=0;//fill(dp, 题解列表 2022年03月28日 0 点赞 0 评论 804 浏览 评分:10.0
优质题解 信息学奥赛一本通T1456-图书管理:啊哈,这道题根本不用哈希,我就是奔着STL来的 这道题真的是用来练哈希表的无疑但是这道题真的用哈希吗?答案是:不用!我们都学过STL没学过去看一下,stack,queue,seet,map,这道题的书名还小于200:正是启用map的好时机!map:一种STL容器它的具体操作有map的基本操作函数:C++maps是一种关联式容器, 题解列表 2022年03月28日 0 点赞 2 评论 1456 浏览 评分:8.7
超级简单版【c++】 ````cpp#includeusingnamespacestd;intmonths[]={0,31,28,31,30,31,30,31,31,30,31,30,31};boolcheck(intyear,intmonth,intday){if(month12||day 题解列表 2022年03月28日 0 点赞 0 评论 553 浏览 评分:9.0
编写题解 1204: 大小写转换 摘要:解题思路:注意事项:参考代码:#include<iostream>#include <iomanip>#include<ctype.h>using namespace std;int main(){ …… 题解列表 2022年03月28日 0 点赞 0 评论 627 浏览 评分:0.0
编写题解 1203: 多输入输出练习2 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<math.h>#include <iomanip>#define PI 3.1415using namespace …… 题解列表 2022年03月28日 0 点赞 0 评论 542 浏览 评分:0.0