题解列表

筛选

雇佣兵(while循环)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int m,n,x,i,a; scanf("%d %d %d",&m,&n,&x……

编写题解:分解质因数【Python】

摘要:解题思路:首先自定义函数判断是否为质数;分解质因数时:先找最小质因数flag,然后递归找n//flag的最小质因数参考代码:# 自定义函数来判断是否是质数 def isPrime(n):     ……
优质题解

括弧匹配检验

摘要:解题思路: (1)初始创立一个空栈。 (2)逐个读入括号。 (3)如果是左括号,那么就压入栈中。 (4)如果是右括号,则先检查栈是否为空,如果栈为空,则表示无左括号与之匹配,匹配失败。如果栈不……

表达式括号匹配(stack)

摘要:解题思路: 运用栈的性质 ```cpp #include using namespace std; int main() { string s; getline(cin, s);//……

c++三行题解

摘要:解题思路:使用强转输出数据注意事项:while的循环读入参考代码:#include<bits/stdc++.h> using namespace std; int main(){     int……