XMZ_LL
XMZ_LL
全部文章
分类
归档
标签
去牛客网
登录
/
注册
XMZ_LL的博客
全部文章
(共45篇)
题解 | #汽水瓶#
while True: n=int(input()) if n==0: break else: k=n%2 m=n//2 res=m print(m)
2024-02-06
0
127
题解 | #简单密码#
def convert(code): res=[] mystring='abcdefghijklmnopqrstuvwxyza' for i in code: if i.islower(): if i in 'abc': ...
2024-02-06
0
138
题解 | #购物单#
n,m=map(int,input().split()) primary={} for i in range(1,m+1): v,p,q=map(int,input().split()) if q==0 and i not in primary: primary[i]...
2024-02-01
0
173
题解 | #购物单#
n,m=map(int,input().split()) primary={} for i in range(1,m+1): v,p,q=map(int,input().split()) if q==0 and i not in primary: primary[i...
2024-02-01
0
143
题解 | #求int型正整数在内存中存储时1的个数#
num=int(input()) temp=0 i=0 while num!=0 : assert i<=32 temp=temp+(num%2) num=int(num/2) i+=1 print(temp)
2024-02-01
0
140
题解 | #求int型正整数在内存中存储时1的个数#
num=int(input()) temp=0 while num!=0: temp=temp+(num%2) num=int(num/2) print(temp)
2024-02-01
0
127
题解 | #字符串排序#
n=int(input()) mystr=[] for _ in range(n): s=input() mystr.append(s) mystr.sort() [print(i) for i in mystr]
2024-01-30
0
134
题解 | #句子逆序#
s= input().split() res=s[::-1] print(' '.join(res))
2024-01-30
0
116
题解 | #字符串反转#
s=input() #assert len(s)<1000 assert s.islower() res=s[::-1] print(res) #assert语句主要用于在代码中插入断言,以便在开发和调试过程中进行一些基本的测试。如果表达式为True,则不会有任何影响;如果为False,则会引...
2024-01-30
0
131
题解 | #数字颠倒#
s=input() #倒序遍历 # mylen=len(s) # res=[] # for i in range(mylen): # res.append(s[mylen-i-1]) # print(''.join( res) ) #字符串切片特性s[首:尾:步长] res=s[::-1...
2024-01-30
0
123
首页
上一页
1
2
3
4
5
下一页
末页