李明新
李明新
全部文章
分类
题解(1)
归档
标签
去牛客网
登录
/
注册
李明新的博客
全部文章
(共79篇)
题解 | #统计每个月兔子的总数#
month = int(input()) def fx(n): if n == 1 or n == 2: return 1 else: return fx(n - 1) + fx(n - 2) # 递归函数 num = fx(month) p...
2023-04-03
0
178
题解 | #字符串加密#
letters = "abcdefghijklmnopqrstuvwxyz" key = input().lower() word = input().lower() k = "" ind = [] # 对key去除重复 for i in key: if i not in k: ...
2023-04-03
0
149
题解 | #蛇形矩阵#
num = int(input()) l = [1] for i in range(2, num + 1): l.append(l[i - 2] + i) print(" ".join(list(map(str, l)))) for j in l: l.pop(0) l = ...
2023-04-02
0
242
题解 | #整数与IP地址间的转换#
IP = list(map(int, input().split("."))) Num = int(input()) ip = "" for i in IP: i = format(i, "b").rjust(8, "0") ip = ip + i print(int(ip, 2))...
2023-04-02
0
165
题解 | #单词倒排#
import re words = input() sp = re.findall("[^a-zA-Z]", words) for i in sp: words = words.replace(i, " ") words = words.split() # 打印方法一 print(" "....
2023-03-31
0
147
题解 | #字符串合并处理#
import re strinput = input().split() str1 = strinput[0] str2 = strinput[1] string = str1 + str2 strodd = [] streven = [] stringList = [] result = [...
2023-03-31
0
267
题解 | #字符串加解密#
import re wordold = input() wordnew = input() outputold = [] outputnew = [] # 加密 for i in wordold: if i in re.findall("[a-y]", i): output...
2023-03-31
0
264
题解 | #查找兄弟单词#
fp = input().split() wordList = [] result = [] for i in range(int(fp[0])): wordList.append(fp[i + 1]) word = fp[-2] num = int(fp[-1]) for j in wor...
2023-03-30
0
187
题解 | #字符串排序#
import re string = input() position = [] letters = re.findall('[A-Za-z]', string) result = sorted(letters, key=str.upper) for i in range(len(string)):...
2023-03-30
0
186
题解 | #数据分类处理#
I = input().split() R = input().split() Icount = int(I[0]) Rcount = int(R[0]) I.pop(0) R.pop(0) Rr = list(map(str, sorted(list(set(list(map(int, R))))...
2023-03-24
0
216
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页