平凡的人5
平凡的人5
全部文章
题解
归档
标签
去牛客网
登录
/
注册
平凡的人5的博客
全部文章
/ 题解
(共37篇)
题解 | #字符串分隔#
in_str = input() 使用字符串的lstrip还是rstrip方法补零,方法忘了,查一下 采用长度对8取余法,余数是多少,就补充8-余数个零 zero_count = 8-(len(in_str)%8) #print(zero_count) if zero_count ==8: zero...
Python3
2022-04-16
0
318
题解 | #计算某字符出现次数#
in_str = input().lower() in_word = input().lower() # 获取第二行字符,都转换成小写 #in_list = in_str.split() 打印一下列表,看看啥样,结果没有获取第二行字符 print(in_list) print(in_word) 计...
Python3
2022-04-16
0
280
题解 | #密码强度等级#
我一定是一个大冤种,查了各种信息,穷举了无数次才解出来,如果你看到了,请点个赞支持一下,谢谢 in_str = input() 1长度 if len(in_str) <= 4: len_score = 5 elif len(in_str) > 4 and len(in_str) <...
Python3
2022-04-15
0
433
题解 | #自守数#
while True: try: n = int(input()) if n<1 or n>10000: break count = 0 for i in range(0,n+1): # 获得平方数的字符串 pf = str(i*i) # 获得i的长度 len_i = len(str(i...
Python3
2022-04-15
0
377
题解 | #字符统计#
我感觉写的好复杂啊,这题让我对reverse和sort有更深的理解 while True: try: # 获取输入字符串 in_str = input() if len(in_str)<1 or len(in_str)>1000: break # 定义一个字典存储字母和数字的数量,要定义...
Python3
2022-04-15
0
382
题解 | #求最小公倍数#
# 我写的好复杂啊,A,B最小公倍数 = 两个数的最大公约数M*(A/M)*(B/M) while True: try: num_list = input().split() &n...
Python3
2022-04-15
0
432
题解 | #挑7#
n = int(input()) if n<1 or n>30000: print(-1) count = 0 for i in range(1,n+1): if i%7 ==0 or ('7' in str(i)) : #print(i) count +=1 print(count)
Python3
2022-04-14
0
293
首页
上一页
1
2
3
4
下一页
末页