2945: 素数对(简单解) 摘要:AC代码 代码解析: is_prime函数:该函数用来判断一个数字是否为素数。如果数字小于2,直接返回false。然后从2开始,依次遍历到sqrt(num),如果存在某个数能整除num,则返回…… 题解列表 2023年08月02日 0 点赞 0 评论 404 浏览 评分:9.9
2947(C++简单解) 摘要:AC代码: ```cpp #include using namespace std; void findUnluckyMonths(int w) { int daysInM…… 题解列表 2023年08月02日 0 点赞 0 评论 276 浏览 评分:0.0
2950: 素数回文数的个数(C++简单解) 摘要:代码解析: isPrime函数:该函数用于判断一个数是否为素数。首先判断如果n小于2,则直接返回false,因为小于2的数不是素数。然后使用一个循环从2开始到sqrt(n)判断是否存在一个数能整除n…… 题解列表 2023年08月02日 0 点赞 0 评论 470 浏览 评分:9.9
题目 1681: 数据结构-行编辑程序 摘要:解题思路:栈的基本操作中的初始化,入栈和出栈注意事项:见 代码参考代码:#define _CRT_SECURE_NO_WARNINGS 1#include <stdio.h>#include <std…… 题解列表 2023年08月02日 0 点赞 0 评论 265 浏览 评分:0.0
2954: 大整数乘法(C++简单解) 摘要:代码解析: multiply函数:该函数接受两个字符串num1和num2,返回它们相乘的结果。首先创建一个大小为n1 + n2的结果数组result,用于存储乘积的每一位数值。 使用两层嵌套的循环…… 题解列表 2023年08月01日 0 点赞 0 评论 356 浏览 评分:9.9
1465: 蓝桥杯基础练习VIP-回形取数(C++) 摘要:AC代码: ```cpp #include #include using namespace std; vector spiralOrder(const vector& matr…… 题解列表 2023年08月01日 0 点赞 0 评论 352 浏览 评分:9.9
2945: 素数对(C++题解) 摘要:###定义一个bool型函数isPrime,接下来for循环即可 # 上代码! ```cpp //School// #include #include//调用sqrt函数需要写数学库头文件c…… 题解列表 2023年08月01日 0 点赞 0 评论 365 浏览 评分:9.9
8皇后 改(dfs) 摘要:解题思路:基本的dfs 改改最后的操作即可注意事项:对角线的表示参考代码:#include<iostream> using namespace std; const int N=9; int n…… 题解列表 2023年08月01日 0 点赞 0 评论 217 浏览 评分:9.9
八皇后(前三行)(总个数) 摘要:解题思路:dfs回溯 前三行要判断注意事项:对角线表示参考代码:#include<iostream> using namespace std; const int N=10010; int n,…… 题解列表 2023年08月01日 0 点赞 0 评论 220 浏览 评分:9.9
x皇后问题—字典序最小(dfs) 摘要:解题思路:dfs回溯即可,第一个即为字典序最小注意事项:记得终止程序参考代码:#include<iostream> using namespace std; const int N=10010;…… 题解列表 2023年08月01日 0 点赞 0 评论 211 浏览 评分:9.9