牛客404425958号
牛客404425958号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客404425958号的博客
全部文章
(共214篇)
题解 | #表达式求值# eval()
# eval() 执行一个字符串表达式,并返回表达式的值。 while True: try: arithmetic=input() print(eval(arithmetic)) except: break
2024-11-09
0
40
题解 | #输出单向链表中倒数第k个结点#
''' # 列表方法: while True: try: n=int(input()) num=input().split() k=int(input()) print(num[n-k]) # 倒数第0个,没有值,输出空值 ...
2024-11-09
0
33
题解 | #杨辉三角的变形#
''' 1 2 3 4 5 6 7 8 9 1 3 5 7 9 11 13 15 17 l=[[None,1,None],[1,1,1]] print(l) ''' '''占用内存太大,报红 while True: try: n=int(input()) ...
2024-11-08
0
49
题解 | #统计字符#
#print(ord('a'),ord('z'),ord('A'),ord('Z'),ord(' '),ord('0'),ord('9')) while True: try: string=str(input()) English=0 bla...
2024-11-08
0
48
题解 | #统计每个月兔子的总数#
'''斐波那契数列 1 1 1 1 2 1 1 3 1 1 ...
2024-11-08
0
34
题解 | #蛇形矩阵#
''' 1*1 1*2 1*3 1*4 1*5 1 3 6 10 15 i*(i+1)/2 2*1 2*2 2*3 2*4 2 5 9 14 -1 3*1 3*2 3*3 4 8 13 -1 4*1 4*2 ...
2024-11-08
0
33
题解 | #图片整理#
#print(sorted('Ihave1nose2hands10fingers')) #print('Ihave1nose2hands10fingers'.sort()) ''' while True: try: string=str(input()) s...
2024-11-08
0
32
题解 | #单词倒排#
''' from re import L l=list('I am a student'.split()) l1=reversed(l) print(l,l1) #print(ord('a'),ord('z'),ord('A'),ord('Z')) ''' ''' while True: t...
2024-11-08
0
61
题解 | #删除字符串中出现次数最少的字符#
''' a='aabcddd' b=a.replace('b','') print(b) print(a.count('d')) ''' string=str(input()) cnt={} for i in string: cnt[i]=string.count(i) cnt_min=m...
2024-11-08
0
39
题解 | #汽水瓶#递归函数/循环条件嵌套语句
''' 1/3=0---1 0 2/3=0---2 0 (0+2+1)/3=1---0 0+1=1 3/3=1---0 1 4/3=1---1 1 (1+1+1)/3=1---0 1+1=2 5/3=1---2 1 (...
2024-11-07
0
53
首页
上一页
6
7
8
9
10
11
12
13
14
15
下一页
末页