2782: 整数大小比较 摘要:while 1: try: while 1: x,y = map(int,input().strip().split()) if (x …… 题解列表 2022年11月27日 0 点赞 0 评论 686 浏览 评分:0.0
编写题解 1030: [编程入门]二维数组的转置 摘要:解题思路:将数组处理为最原始的样子(也就[[1,2,3],[4,5,6],[7,8,9]])注意事项:理解二维数组的运算方式参考代码:lst = []for i in range(3): j =…… 题解列表 2022年11月27日 0 点赞 0 评论 932 浏览 评分:9.9
2781: 奇偶ASCII值判断 摘要:解题思路:注意事项:参考代码:while 1: try: a = str(input()) if ord(a) % 2 == 0: print(…… 题解列表 2022年11月27日 0 点赞 0 评论 622 浏览 评分:0.0
2779: 输出绝对值 摘要:解题思路: 这道题考察的是条件语句的应用注意事项:参考代码:a = float(input())if a >= 0: print('{:.2f}'.format(a)) #第一…… 题解列表 2022年11月27日 0 点赞 0 评论 879 浏览 评分:2.0
2778: 判断数正负 摘要:解题思路: while循环控制输入 if条件判断控制范围注意事项:参考代码:while 1: a = int(input()) if a <= -1E9 or a >= 1E9: #…… 题解列表 2022年11月27日 0 点赞 0 评论 688 浏览 评分:2.0
编写题解 1046: [编程入门]自定义函数之数字后移(有细致的讲解) 解题思路:注意事项:参考代码:#index,在列表某一确定位置插入确定的东西(insert()方法在指定位置插入指定的值。),#pop()函数用于移除列表中的一个元素(默认最后一个元素),并且返回该元素的值。n=int(input())index=list(map(int, 题解列表 2022年11月26日 0 点赞 0 评论 617 浏览 评分:0.0
编写题解 1045: [编程入门]自定义函数之整数处理(讲解比较清晰,至少我认为,含函数与函数之间传参的问题) 摘要:解题思路:通过调用index()函数来查找位置之后通过列表的特点进行交换注意事项:函数参数间的参数的传递参考代码:def shuru(): a=list(map(int,input().spli…… 题解列表 2022年11月26日 0 点赞 0 评论 570 浏览 评分:8.0
2775: 等差数列末项计算 解题思路:注意事项:参考代码:a,b,n=map(int,input().strip().split())print(a+(n-1)*(b-a))#等差数列公式:an=an+(n-1)*d,#d是等差数列的公差 题解列表 2022年11月26日 0 点赞 0 评论 860 浏览 评分:9.9
2774: 计算三角形面积 解题思路:注意事项:参考代码:importmathx1,y1,x2,y2,x3,y3=map(float,input().strip().split())a=math.sqrt((x1-x2)**2+(y1-y2)**2)#计算边长b=math.sqrt((x1-x3)**2+(y1-y3)**2)c 题解列表 2022年11月26日 0 点赞 0 评论 975 浏览 评分:9.3
2772: 苹果和虫子 摘要:解题思路:注意事项:参考代码:import mathn, x, y = map(int,input().strip().split())print(math.floor(n - y / x)) …… 题解列表 2022年11月26日 0 点赞 0 评论 839 浏览 评分:4.7