1029: [编程入门]自定义函数处理素数 摘要:解题思路:注意事项:参考代码:a = int(input())for i in range(2,a//2+1): if a % i == 0: print("not prime")…… 题解列表 2021年10月14日 0 点赞 0 评论 614 浏览 评分:0.0
1036: [编程入门]带参数宏定义练习-题解(python代码) 摘要:解题思路:注意事项:参考代码:a,b = map(int,input().split())a,b = b,aprint("{} {}".format(a,b))…… 题解列表 2021年10月14日 0 点赞 0 评论 433 浏览 评分:6.0
1041: [编程入门]宏定义之找最大数-题解(python代码) 摘要:解题思路:注意事项:参考代码:a,b,c = map(int,input().split())d = max(a,b,c)print("{:.3f}".format(d))print("{:.3f}"…… 题解列表 2021年10月14日 0 点赞 0 评论 392 浏览 评分:0.0
[编程入门]字符串分类统计,正则4行代码解题思路 摘要:解题思路:利用正则进行匹配注意事项:其他符号由于不好匹配,可采用整个字符串长度减去已知进行求算参考代码:import re strings = input() m, n, p = (len(re.…… 题解列表 2021年10月13日 0 点赞 0 评论 837 浏览 评分:6.0
简单字符串 摘要:解题思路:先将每个字符串遍历,将字符串作为函数参数,在函数中遍历每个字符,判断该字符与后一个字符是否相等,是则统计个数。注意事项:每次遍历都要将count置为1(当与后一个字符不等时)参考代码:def…… 题解列表 2021年10月13日 0 点赞 0 评论 760 浏览 评分:9.9
题目 1018: [编程入门]有规律的数列求和 摘要:解题思路:每一项为前一项倒数加一注意事项:参考代码:N = int(input())sum = 0c = 1 #分式for i in range(N): c = 1 / c + 1 sum…… 题解列表 2021年10月13日 0 点赞 0 评论 309 浏览 评分:0.0
1026: [编程入门]数字逆序输出-题解(python) 摘要:解题思路:注意事项:参考代码:l = list(map(int,input().split()))for i in l[::-1]: print(i,end=' ')…… 题解列表 2021年10月13日 0 点赞 0 评论 665 浏览 评分:0.0
1025: [编程入门]数组插入处理 -题解(python代码) 摘要:解题思路:注意事项:参考代码:l = list(map(int,input().split()))a = input()l.append(str(a))l[len(l)-1] = int(l[len(…… 题解列表 2021年10月13日 0 点赞 0 评论 893 浏览 评分:9.3
编写题解 1037: [编程入门]python代码 摘要:解题思路:注意事项:宏定义是C语言里的,python没有参考代码:a,b = map(int,input().split())c = a%bprint(c)…… 题解列表 2021年10月13日 0 点赞 0 评论 584 浏览 评分:8.0
[编程入门]有规律的数列求和 摘要:解题思路:注意事项:参考代码:n=int(input())alist=[2,3]blist=[1,2]s=0for i in range(n): alist.append(alist[i]+al…… 题解列表 2021年10月12日 0 点赞 0 评论 757 浏览 评分:0.0