大鹏

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

03 2022 档案

摘要:1 while True: 2 try: 3 num = int(input()) 4 stack = [] 5 for i in range(num): 6 stack.append(input()) 7 print("\n".join(sorted(stack))) 8 except: 9 br 阅读全文
posted @ 2022-03-31 20:42 pf42280 阅读(38) 评论(0) 推荐(0) 编辑

摘要:跑通代码 理解 自己敲一遍 对照修改 跑通 理解 循环直到完全能自己敲出来并且理解整个代码 自己整理的 1 while True: 2 try: 3 a = input() 4 a = a.split() #将输入的字符串以空格分开,转为列表 5 if len(a)>10000 or len(a)= 阅读全文
posted @ 2022-03-29 23:05 pf42280 阅读(52) 评论(0) 推荐(0) 编辑

摘要:1 字典的方式 1 dic = {} 2 n = int(input()) #没理解 3 while True: 4 try: 5 line = input() 6 tmp = line.split() 7 index = int(tmp[0]) 8 value = int(tmp[1]) 9 if 阅读全文
posted @ 2022-03-29 21:56 pf42280 阅读(39) 评论(0) 推荐(0) 编辑

摘要:1 m =list(map(str,input().split())) 2 print(m) 3 str1 = m[-1].rstrip() 4 print(len(str1)) 5 6 print(len(list(map(str,input().split()))[-1].rstrip())) 阅读全文
posted @ 2022-03-27 22:13 pf42280 阅读(150) 评论(0) 推荐(0) 编辑

摘要:1、 1 def fun(num): 2 3 if num[-1]!=0: 4 temp=[] 5 num_list=list(num) 6 for i in num_list[::-1]: 7 if i not in temp: 8 temp.append(i) 9 else: 10 print( 阅读全文
posted @ 2022-03-24 23:18 pf42280 阅读(124) 评论(0) 推荐(0) 编辑