摘要: python 实现 num=int(input()) lst=[] while True: s=str(input()) if s!="End": lst.append(s) else: break count=0 for item in lst: if count!=num: if item==" 阅读全文
posted @ 2024-07-03 16:05 豆豆是只乖狗狗 阅读(2) 评论(0) 推荐(0) 编辑
摘要: python 实现 num=int(input()) lst_res=[] for i in range(num): temp=str(input()) if int(temp[0])+int(temp[1])+int(temp[2]) == int(temp[3])+int(temp[4])+in 阅读全文
posted @ 2024-07-03 15:42 豆豆是只乖狗狗 阅读(1) 评论(0) 推荐(0) 编辑
摘要: python 实现 num1=int(input()) lst_id=[] lst_shiji=[] lst_kaoshi=[] for i in range(num1): s=input() lst_id.append(int(s.split(" ")[0])) lst_shiji.append( 阅读全文
posted @ 2024-07-03 15:32 豆豆是只乖狗狗 阅读(4) 评论(0) 推荐(0) 编辑
摘要: python 实现 num=int(input()) lst=[] for i in range(num): s=input() a=int(s.split(" ")[0]) b=int(s.split(" ")[1]) res=int(s.split(" ")[2]) if a*b==res: l 阅读全文
posted @ 2024-07-03 11:31 豆豆是只乖狗狗 阅读(5) 评论(0) 推荐(0) 编辑
摘要: python 实现 s=input() sum=int(s.split(" ")[0])+int(s.split(" ")[1]) fac=1 for i in range(1,sum+1): fac=fac*i print(fac) 阅读全文
posted @ 2024-07-03 11:25 豆豆是只乖狗狗 阅读(12) 评论(0) 推荐(0) 编辑
摘要: python 实现 注:输入的数据需要在区间 [1,1000] 内 s=input() loc=s.index(" ") a=s[:loc] b=s[loc+1:] if a.isdecimal() and b.isdecimal(): if int(a) in [i for i in range( 阅读全文
posted @ 2024-06-30 20:54 豆豆是只乖狗狗 阅读(15) 评论(0) 推荐(0) 编辑
摘要: python 实现 注:测试的时候最后一个测试点总是不通过,最后发现,测试数据可能是一个不含空格的长单词,单词内同样包含6,如: 输入: zhangsan666-lisi666666-wangwu6666666666 输出: zhangsan666-lisi9-wangwu27 s=input() 阅读全文
posted @ 2024-06-30 16:50 豆豆是只乖狗狗 阅读(4) 评论(0) 推荐(0) 编辑
摘要: python 实现 s=input() num=int(s.split(" ")[0]) dream_price=int(s.split(" ")[1]) lst=[] for i in range(num): real_price=float(input()) if real_price<drea 阅读全文
posted @ 2024-06-30 13:07 豆豆是只乖狗狗 阅读(1) 评论(0) 推荐(0) 编辑
摘要: python实现 num=int(input()) s=input() sum=0.0 for i in range(num): f=1.0/float(s.split(" ")[i]) sum+=f sum=1.0/(sum/float(num)) print("{:.2f}".format(su 阅读全文
posted @ 2024-06-30 12:58 豆豆是只乖狗狗 阅读(3) 评论(0) 推荐(0) 编辑
摘要: python 实现 s=input() year=s[:len(s)-2] month=s[len(s)-2:len(s)] if len(year)==4: print("{year}-{month}".format(year=year, month=month)) else: if int(ye 阅读全文
posted @ 2024-06-29 17:39 豆豆是只乖狗狗 阅读(4) 评论(0) 推荐(0) 编辑