3021基础解法(Python) 摘要:注意事项:题目下标问题参考代码:n_num = int(input())for i in range(n_num) : n_in = int(input()) if n_in == 1 :…… 题解列表 2023年02月28日 0 点赞 0 评论 299 浏览 评分:9.9
dfs简单且明了-Python 摘要:解题思路:就是想吐槽一下:题目都说了由不同字母组成 但是测试用例有相同的 害我第一次没通过 真老6注意事项:方法:就是要用下标1-n来对应input输入的字母保证不会重复 最后再输出下标对应的字母就o…… 题解列表 2023年02月28日 0 点赞 0 评论 682 浏览 评分:8.0
[编程入门]自定义函数处理素数 摘要:解题思路:注意事项:参考代码:from math import sqrtdef isPrime(n): if n==1: return False for j in rang…… 题解列表 2023年02月27日 0 点赞 0 评论 162 浏览 评分:0.0
python解决复数求和问题 摘要:解题思路:首先输入行数,其中n代表几行其次定义变量,分别输入实部和虚部a,b最后对实部 虚部分别进行求和即可参考代码:n=int(input()) s,x=0,0 for _ in range(n…… 题解列表 2023年02月27日 0 点赞 0 评论 179 浏览 评分:0.0
2869: 字符串最大跨距 摘要:解题思路:注意事项:参考代码:s,s1,s2 = input().strip().split(",") if s1 in s and s2 in s: a = s.index(s1) …… 题解列表 2023年02月26日 0 点赞 0 评论 239 浏览 评分:2.0
2867: 单词的长度(python) 摘要:解题思路:注意事项:参考代码:s = list(input().strip().split()) l = [str(len(i)) for i in s] print(",".join(l))…… 题解列表 2023年02月26日 0 点赞 0 评论 332 浏览 评分:9.9
2866: 过滤多余的空格(python) 摘要:解题思路:注意事项:参考代码:s = list(input().strip().split()) print(" ".join(s))…… 题解列表 2023年02月26日 0 点赞 0 评论 293 浏览 评分:9.9
2864: 单词替换(python) 摘要:解题思路:注意事项:参考代码:#注意去掉前导后导空格 #先把字符串转为列表,直接用replace会有问题(比如句子中的want可能ant会被替换) s = list(input().strip()…… 题解列表 2023年02月26日 0 点赞 1 评论 305 浏览 评分:9.9
python求解年月日问题 摘要:解题思路:注意事项:参考代码:year,month,day=map(int,input().split())sum=daydays = [31,28,31,30,31,30,31,31,30,31,3…… 题解列表 2023年02月26日 0 点赞 0 评论 197 浏览 评分:0.0
Python递推解决约瑟夫环 摘要:解题思路:注意事项:参考代码:n,k=map(int,input().split())a=list(range(1,n+1))s=0for i in range(2,n+1): s=(s+k)%…… 题解列表 2023年02月25日 0 点赞 1 评论 241 浏览 评分:0.0