吾不知鱼乐
吾不知鱼乐
全部文章
分类
题解(8)
归档
标签
去牛客网
登录
/
注册
吾不知鱼乐的博客
全部文章
(共7篇)
题解 | #字符串加解密#
s1 = input() s2 = input() s3 = '' s4 = '' # 加密过程 for i in s1: if i.isdigit(): # 对数字进行加密 s3 += str((int(i)+1)%10) elif i.isalpha(): # 对...
Python3
2022-04-09
0
380
题解 | #密码强度等级#
import re def fun(pwd): score = 0 # 规则一、密码长度: if len(pwd)<=4: score += 5 elif len(pwd)<=7: score += 10 else...
Python3
2022-04-03
0
371
题解 | #自守数#
通过简单分析可以得知,只有当个位数为0,1,5,6的时候有可能是自守数,所以可以根据此特征来求解: def fun(x): y = x**2 a = str(x) b = str(y) if a==b[-len(a):]: # print(x) ...
Python3
2022-04-03
1
360
题解 | #求最大连续bit数#
import re n = int(input()) s = str(bin(n)) ls = re.findall('1+', s) ls2 = [len(i) for i in ls] print(max(ls2))
Python3
2022-03-31
0
291
题解 | #统计大写字母个数#
import re print(len(''.join(re.findall(r'[A-Z]', input()))))
Python3
2022-03-29
0
269
题解 | #二维数组操作#
```while True: try: m, n = map(int, input().split()) if m<=9 and n<=9: print(0) else: print(...
Python3
2022-03-28
0
277
题解 | #统计字符#
import re while True: try: s = input() print(len(''.join(re.findall(r'[a-zA-Z]+', s)))) print(len(''.join(re.findall(r' ',...
Python3
2022-02-19
49
1631