调用函数及封装性解题 摘要:解题思路:def f(a): b=(a%10)*5 a=a//10 if (a-b)%17==0: print("1") else:print("0")while…… 题解列表 2024年11月27日 0 点赞 0 评论 276 浏览 评分:9.9
运用封装的方法和调用函数借以解答汽水瓶问题 摘要:解题思路:def f(water): num=0 while True: if water==2: num+=1 break …… 题解列表 2024年11月26日 0 点赞 0 评论 171 浏览 评分:9.9
遍历每条对角线 摘要:# # 遍历每条对角线 m,n = map(int,input().split()) #m行n列 ans = 0 arr = [] for _ in ra…… 题解列表 2024年11月26日 3 点赞 0 评论 919 浏览 评分:10.0
编写题解 3029: 逆波兰表达式 摘要:inver = input().split() inver = inver[::-1] def arithmetic(inver): if inver: alphabe…… 题解列表 2024年11月25日 0 点赞 0 评论 144 浏览 评分:0.0
编写题解 2330: 信息学奥赛一本通T1178-成绩排序(Python) 摘要:解题思路:利用sorted()函数进行排序注意事项:首先按成绩排序,如果成绩相同则按名字升序参考代码:n = int(input())sc_dict = {}for i in range(n): …… 题解列表 2024年11月23日 0 点赞 0 评论 129 浏览 评分:9.9
不懂可评论 摘要:解题思路:注意事项:参考代码:a,b,c=map(int,input().split()) deter=b*b-4*a*c x1=(-b+deter**0.5)/2*a x2=(-b-deter…… 题解列表 2024年11月23日 0 点赞 0 评论 121 浏览 评分:0.0
不懂可评论 摘要:解题思路:注意事项:参考代码:year=int(input()) if((year%4==0)and(year%100!=0)or(year%400==0)): print("Y") e…… 题解列表 2024年11月23日 0 点赞 0 评论 105 浏览 评分:0.0
不懂可评论 摘要:解题思路:注意事项:参考代码:x=int(input()) for pen4 in range(x//4,-1,-1):#优先买4元的笔,开始循环递减到0结束 remaining=x-pe…… 题解列表 2024年11月21日 0 点赞 0 评论 95 浏览 评分:9.9
不懂可评论 摘要:解题思路:注意事项:参考代码:days= ['Monday', 'Tuesday', 'Wednesday', 'Thursday', …… 题解列表 2024年11月20日 1 点赞 0 评论 148 浏览 评分:0.0
不懂可评论 摘要:解题思路:注意事项:参考代码:luggage=float(input()) if luggage<=20: print("%.2f"%(luggage*1.68)) else: …… 题解列表 2024年11月20日 0 点赞 0 评论 99 浏览 评分:0.0