牛客567146676号
牛客567146676号
全部文章
分类
题解(7)
归档
标签
去牛客网
登录
/
注册
牛客567146676号的博客
全部文章
(共7篇)
Python一行搞定 | #查找输入整数二进制中1的个数#
while True: try: a = int(input()) print(str(bin(a))[2:].count("1")) except: break
2021-08-12
0
369
Python最简单 | #高精度整数加法#
python应该是最简单的了吧,直接上代码 while True: try: a = input() b = input() print(eval(a+"+"+b)) except: break
2021-08-11
1
467
Python3 #挑7#
while True: try: a = int(input()) count = 0 if a >=7: for i in range(7, a+1): if "7" in...
2021-08-11
0
234
Python题解 | #识别有效的IP地址和掩码并进行分类统计#
a = b = c = d = e = wrongIP = privateIP = 0 import re def bins(strs): results = "" strs = strs.split(".") for i in st...
2021-07-16
0
457
Python正则 | #坐标移动#
inpt = input() import re strs = inpt.split(";") A = 0 S = 0 W = 0 D = 0 c = ["A", "S", "W", "D"] for...
2021-07-14
3
539
Python 题解 | #求int型正整数在内存中存储时1的个数#
bin_num = int(input().strip()) res = 0 if bin_num: bins = str(bin(bin_num)) print(bins.count("1")) else: print(0)
2021-07-14
2
389
Python
inpt = int(input()) strs = [] for i in range(inpt): strs.append(input())  ...
2021-07-14
2
442