莫燿汶
莫燿汶
全部文章
分类
题解(62)
归档
标签
去牛客网
登录
/
注册
莫燿汶的博客
第一语言python的小白
全部文章
(共60篇)
题解 | #记负均正II#
import sys inpstr = [int(line) for line in sys.stdin] a = 0 b = 0 c = 0 for i in inpstr: if i < 0: a += 1 # 判断负数个数 else: b...
Python3
2022-04-05
0
224
题解 | #输入n个整数,输出其中最小的k个#
inpstr = input().split() inpstr01 = input().split() def keys(ss): return int(ss) inpstr01.sort(key=keys) for i in range(int(inpstr[1])): print...
Python3
2022-04-05
0
258
题解 | #字符串加密#
password = input() # 获取目标密码 letter = "abcdefghijklmnopqrstuvwxyz" str_c = "" for i in str_a: if i not in str_c: # 秘钥去重 str_c += i for j ...
Python3
2022-04-04
0
207
题解 | #图片整理#
inpstr = input() list01 = [] for i in inpstr: list01.append([i, ord(i)]) # 获取对应的ASCII值 def sortli01(ss): return ss[1] # 利用ASCII值进行排序,也可以用list...
Python3
2022-04-04
0
243
题解 | #在字符串中找出连续最长的数字串#
import sys list01 = [line.replace("\n", "") for line in sys.stdin] # 获取所有输入值 for i in list01: stri = "" for j in i: if j.isdecimal()...
Python3
2022-04-03
0
316
题解 | #名字的漂亮度#
python3简单解法 input_num = input() n = 0 while n < int(input_num): name = input() le_lis = [] num_lis = [] for letter in name: ...
Python3
2022-03-20
0
251
题解 | #单词倒排#
words = input() for letter in words: if not letter.isalpha(): # 判断非字母 words = words.replace(letter, " ") # 使用间隔(空格)替换 new_words = (words...
Python3
2022-03-20
0
261
题解 | #汽水瓶#
lis = [] while True: num = input() if num == "0": break else: lis.append(num) lis1 = [] for n in lis: tatol = 0 n ...
Python3
2022-03-20
0
223
题解 | #简单密码#
python3简单解法 dic = {"2": ["a", "b", "c"], "3": ["d", "e", "f"], "4":["g", "h", "i"], "5":["j", "k", "l"], "6": ["m", "n", "o"], "7": ["p", "q",...
Python3
2022-03-19
0
300
题解 | #坐标移动#
python初学,确实如果思路到就不难,就只是筛选跟判断的问题,早上起来就给他干了 coordinate = list(input().split(";")) # 使用“;”进行切片分割出每一个坐标信息,转换成列表 list1 = ["A", "W", "S", "D"] list2 = [] f...
Python3
2022-03-13
0
374
首页
上一页
1
2
3
4
5
6
下一页
末页