题解列表
1041: [编程入门]宏定义之找最大数
摘要:```c
#include
#define maxx(x,y,z) (x>y?x:y)>z?(x>y?x:y):z
double computer(double x,double y,doubl……
1047: [编程入门]报数问题
摘要:```cpp
#include
int nodes[150];
int main()
{
int n,m=3;
scanf("%d",&n);
for(int i=0;i1)
……
表达式括号匹配(stack)
摘要:解题思路:
运用栈的性质
```cpp
#include
using namespace std;
int main() {
string s;
getline(cin, s);//……
蓝桥杯算法提高VIP-夺宝奇兵 dp问题从上至下解决 时间复杂度O(n^2)
摘要:解题思路:从上至下累计递推就行了,注意对应关系,从上来说对应下面同列的和后一列的,如果有一个数由前一行两个数对应需要累加,只需要比较最大值就行最后只看最后一行取最大值即为最终答案。注意事项:参考代码:……
编写题解:分解质因数【Python】
摘要:解题思路:首先自定义函数判断是否为质数;分解质因数时:先找最小质因数flag,然后递归找n//flag的最小质因数参考代码:# 自定义函数来判断是否是质数
def isPrime(n):
……
3074: 计算(calc)
摘要:参考代码:
```cpp
#include
using namespace std;
stacknum;//存储数字
stackch;//存储字符
string str;//定义字符串
……
奇偶ASCII值判断 (Java)
摘要:import java.util.Scanner;
public class Main {
public static void main(String[] args) {
S……
2772:苹果与虫子
摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n,x,y; scanf("%d%d%d",&n,&x,&y); if(y%x==0) prin……