1047: [编程入门]报数问题 摘要:```cpp #include int nodes[150]; int main() { int n,m=3; scanf("%d",&n); for(int i=0;i1) …… 题解列表 2022年12月07日 0 点赞 0 评论 297 浏览 评分:9.9
表达式括号匹配(stack) 摘要:解题思路: 运用栈的性质 ```cpp #include using namespace std; int main() { string s; getline(cin, s);//…… 题解列表 2022年12月07日 0 点赞 0 评论 756 浏览 评分:9.9
优质题解 括弧匹配检验 摘要:解题思路: (1)初始创立一个空栈。 (2)逐个读入括号。 (3)如果是左括号,那么就压入栈中。 (4)如果是右括号,则先检查栈是否为空,如果栈为空,则表示无左括号与之匹配,匹配失败。如果栈不…… 题解列表 2022年12月07日 0 点赞 0 评论 543 浏览 评分:9.9
蓝桥杯算法提高VIP-夺宝奇兵 dp问题从上至下解决 时间复杂度O(n^2) 摘要:解题思路:从上至下累计递推就行了,注意对应关系,从上来说对应下面同列的和后一列的,如果有一个数由前一行两个数对应需要累加,只需要比较最大值就行最后只看最后一行取最大值即为最终答案。注意事项:参考代码:…… 题解列表 2022年12月07日 0 点赞 0 评论 375 浏览 评分:9.9
编写题解:分解质因数【Python】 摘要:解题思路:首先自定义函数判断是否为质数;分解质因数时:先找最小质因数flag,然后递归找n//flag的最小质因数参考代码:# 自定义函数来判断是否是质数 def isPrime(n): …… 题解列表 2022年12月07日 0 点赞 0 评论 289 浏览 评分:9.9
雇佣兵(while循环) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int m,n,x,i,a; scanf("%d %d %d",&m,&n,&x…… 题解列表 2022年12月07日 0 点赞 0 评论 396 浏览 评分:0.0
很简单的一种思路,可以不用到数组 摘要:```c //思路是先把A的因子和算出来得出B,然后判断B的因子和是否等于A,是则是亲密数 #include int main() { for(int a=2;a…… 题解列表 2022年12月07日 0 点赞 0 评论 351 浏览 评分:2.0
编写题解:数的读法【Python】 摘要:解题思路:每四位分开读,具体见代码和注释参考代码:d = {'1':'yi', '2':'er', '3':'s…… 题解列表 2022年12月07日 0 点赞 0 评论 489 浏览 评分:10.0
3074: 计算(calc) 摘要:参考代码: ```cpp #include using namespace std; stacknum;//存储数字 stackch;//存储字符 string str;//定义字符串 …… 题解列表 2022年12月07日 0 点赞 0 评论 514 浏览 评分:9.9
1017: [编程入门]完数的判断 摘要:```cpp #include int n,i,sum=0,a[1000],j=0; void yin(int n) { j=0; sum=0; for(i=1;i…… 题解列表 2022年12月07日 0 点赞 0 评论 299 浏览 评分:0.0