自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:def function(a, b): c = min(a, b) max_GCD = 0 for i in range(1, c + 1)…… 题解列表 2024年04月18日 0 点赞 0 评论 514 浏览 评分:0.0
十行简便 有规律的数列求和 摘要:解题思路:利用列表的方式注意事项:注意两位小数参考代码:n=int(input())a=[2]b=[1]s=0for i in range(n): a.append(a[i]+b[i]) …… 题解列表 2024年04月17日 0 点赞 0 评论 320 浏览 评分:0.0
六行简便 编写题解 1020: [编程入门]猴子吃桃的问题 摘要:解题思路:利用递归的思想注意事项:最后一天亦包括参考代码:n=int(input())s=1while n>1: s=(s+1)*2 n=n-1print(s)…… 题解列表 2024年04月17日 0 点赞 0 评论 324 浏览 评分:0.0
九行简便 编写题解 1022: [编程入门]筛选N以内的素数 摘要:解题思路:f=0,f=1注意事项:for i in range(2,n+1):参考代码:n=int(input())for i in range(2,n+1): f=0 for j in …… 题解列表 2024年04月17日 0 点赞 0 评论 559 浏览 评分:0.0
python--study||O.o 摘要:参考代码:column = int(input()) s = input() row = len(s) // column arr = [list(s[i * column: (i + 1) *…… 题解列表 2024年04月17日 0 点赞 0 评论 301 浏览 评分:0.0
python--study||O.o 摘要:参考代码:dx = (-1, 0, 1, 0) dy = (0, -1, 0, 1) def judge(x, y): if x == 0 or x == n - 1 or y …… 题解列表 2024年04月17日 0 点赞 0 评论 313 浏览 评分:0.0
编写题解 1138: C语言训练-求矩阵的两对角线上的元素之和 摘要:解题思路:注意事项:参考代码:n = int(input()) arr = [list(map(int, input().split())) for _ in range(n)] x, y = 0…… 题解列表 2024年04月17日 0 点赞 0 评论 439 浏览 评分:0.0
1024: [编程入门]矩阵对角线求和 摘要:解题思路:注意事项:参考代码:arr = [list(map(int, input().split())) for _ in range(3)] x, y = 0, 0 for i in rang…… 题解列表 2024年04月17日 0 点赞 0 评论 373 浏览 评分:0.0
python--study||O.o 摘要: 就是求内部矩形的大小,主要问题是根据题意判断起点和终点参考代码:#肿瘤与边缘之间必须被0分隔开(未完全分隔就不算答案) n = int(input()) arr = [list(m…… 题解列表 2024年04月17日 0 点赞 0 评论 357 浏览 评分:0.0
python--study||O.o 摘要:参考代码:#每个草丛只能是1个'#'或2个'#' dx = (-1, 0, 1, 0) dy = (0, -1, 0, 1) def f(x, y): …… 题解列表 2024年04月17日 0 点赞 0 评论 313 浏览 评分:0.0