1029: [编程入门]自定义函数处理素数 摘要:```cpp #include using namespace std; /* 题目描述 写一个判断素数的函数,在主函数输入一个整数,输出是否是素数的消息。 输入格式 一个数 输出…… 题解列表 2023年02月19日 0 点赞 1 评论 202 浏览 评分:9.9
python字符串比较 带解析 摘要:n=list(input().split())a=len(n[0])if len(n[0])>len(n[1]): a=len(n[1])# print(a)for i in range(a):…… 题解列表 2023年02月19日 0 点赞 0 评论 403 浏览 评分:9.9
python字符串输入输出函数 摘要:def GetReal(): x=input() return xdef GetString(): X=input() return Xdef main(): while…… 题解列表 2023年02月19日 0 点赞 0 评论 313 浏览 评分:9.9
python最长字符串 带解析 摘要:s=list(input().split()) #以列表方式存储Max=len(s[0]) #记录字符串最大长度 首先记录第一个n=[] #记录字符串最大长度对应字符的下标n.append(0) #首…… 题解列表 2023年02月19日 0 点赞 0 评论 283 浏览 评分:9.9
大臣的旅费-两次dfs+邻接矩阵或邻接表 摘要:# 树的直径问题,图中所有最短路径的最大值即为直径,两次dfs即可求出 ## 邻接矩阵 这题可以使用dfs+邻接矩阵来做,不过会导致内存超限只能80分。 ``` import java.u…… 题解列表 2023年02月19日 0 点赞 0 评论 447 浏览 评分:9.9
666666666666666666 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstdio>#include<cstring>using namespace std;const int N=1e…… 题解列表 2023年02月20日 0 点赞 0 评论 230 浏览 评分:9.9
1030: [编程入门]二维数组的转置 摘要:```cpp #include using namespace std; /* 题目描述 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换。 输入格式 一个3x3的矩阵 输…… 题解列表 2023年02月20日 0 点赞 1 评论 400 浏览 评分:9.9
题解 2831: 画矩形 摘要:解题思路:注意事项:参考代码:#include <stdio.h> int main() { char ch; int i, j, h, l, flag; //h,高,l,长;flag为空…… 题解列表 2023年02月20日 0 点赞 0 评论 285 浏览 评分:9.9
题解 2832: 第n小的质数 摘要:解题思路:注意事项:参考代码:#include <stdio.h> #include <math.h> int isPrime(int n) { int i, k; k = (i…… 题解列表 2023年02月20日 1 点赞 1 评论 441 浏览 评分:9.9
1033: [编程入门]自定义函数之字符提取 摘要:```cpp #include #include #include using namespace std; /* 题目描述 写一函数,将一个字符串中的元音字母复制到另一个字符串,然后输…… 题解列表 2023年02月20日 0 点赞 1 评论 313 浏览 评分:9.9