首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
课程
专栏·文章
竞赛
搜索
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
在线笔面试、雇主品牌宣传
登录
/
注册
tmacsniper
获赞
0
粉丝
0
关注
0
看过 TA
1
东华大学
2019
测试工程师
IP属地:北京
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑tmacsniper吗?
发布(32)
刷题
tmacsniper
2022-08-22 17:04
测试工程师
题解 | #挑7#
count = 0 number = [] n = int(input()) for i in range(n): j = i+1 if j % 7 == 0: count += 1 number.append(j) else: for k in str(j): if (k == '7') and (j not in number): count += 1 number.append(j) print(count)暴力...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 16:47
测试工程师
题解 | #表达式求值#
s = input() print(int(eval(s)))
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 16:44
测试工程师
题解 | #杨辉三角的变形#
a = int(input()) sum = 0 if a <=2: print(-1) else: if (a-1) % 2 == 0: print(2) else: if (a/2) % 2 == 0: print(3) else: print(4)每一行: 第一个数是1 第二个数是行数a-1 第三个数是从1加到a-1,通过判断从1到a-1这个数列中间值是否为奇数,可判断第三个数 因为奇数加奇数为偶数,所以若第三个数是奇数时,判断上一行的2,...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 16:06
测试工程师
题解 | #输出单向链表中倒数第k个结点#
while True: try: allnumber = int(input()) numberlist = input().split(' ') k = int(input()) if k!=0: print(numberlist[-k]) else: print('') except: break注意倒数从1开始,而不是0开始,所以要把0去掉
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 15:56
测试工程师
题解 | #四则运算#
str = input() str = str.replace('{','(') str = str.replace('}',')') str = str.replace('[','(') str = str.replace(']',')') result = int(eval(str)) print(result)知识点:eval() 函数用来执行一个字符串表达式,并返回表达式的值
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 15:43
测试工程师
题解 | #从单向链表中删除指定值的节点#
a = input().split(' ') b = [] allnumber = int(a[0]) start = a[1] for i in range(allnumber-1): if i == 0: b.append(a[3+i]) b.append(a[2+i]) else: index = b.index(a[3+i*2]) b.insert(index+1,a[2+i*2]) delnumber = a[-1] b.remove(delnumber) for j in b:...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 14:48
测试工程师
题解 | #名字的漂亮度#
stringlist=[] n = int(input()) for i in range(n): stringlist.append(input()) for j in stringlist: sum = 0 alphalist=[] countlist=[] &n...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 00:52
测试工程师
题解 | #统计字符#
alpha = 0 digit = 0 space = 0 other = 0 a = input() for i in a: if i.isalpha() == True: alpha += 1 elif ...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 00:44
测试工程师
题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
allheight = 0 n = int(input()) for i in range(4): allheight += n/(2**i) print(allheight+n) print(n/(2**5))
0
点赞
评论
收藏
转发
tmacsniper
2022-08-22 00:33
测试工程师
题解 | #统计每个月兔子的总数#
while True: try: #获取输入数据 data1 = int(input()) #设置初值 #一个月兔子个数 N1 = 1 #两个月兔子个数 N2 = 0 #三个月以及三个月以上兔子个数 N3 = 0 for n in range(1,data1): N3 = N3 + N2 N2 = N1 N1 = N3 print(N1+N2...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-21 23:34
已编辑
测试工程师
题解 | #字符串加密#
upperlist='A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.split(' ') lowerlist='A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.lower().split(' ') uppertemp=[] lowertemp=[] a = input() b = input() for i in a: if i in upperlist: if i not in upper...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-21 22:56
测试工程师
题解 | #图片整理#
a = input() b = sorted(a) for i in b: print(i,end='')这是我今天做到的最简单的题
0
点赞
评论
收藏
转发
tmacsniper
2022-08-21 22:47
测试工程师
题解 | #整数与IP地址间的转换#
def binary(ip:str): iplist = ip.split('.') templist = [] temp = '' for i in iplist: ten = int(i) bi = bin(ten)[2:] lenbi = len(bi) temp = '0'*(8-len(bi)) + bi templist.append(temp) s = templist[0]+templist[1]+templis...
0
点赞
评论
收藏
转发
tmacsniper
2022-08-21 21:34
测试工程师
题解 | #单词倒排#
a = input() for i in a: if not i.isalpha(): a = a.replace(i,' ') b = a.split() print(*b[::-1])摘抄解法知识点 字符串的replace方法split()与split(' ')的区别:前若有连续两个空格会被删除,后则会有一个空格的元素被保留print内加星号代表元组[::-1]代表逆向操作
0
点赞
评论
收藏
转发
tmacsniper
2022-08-21 20:58
测试工程师
题解 | #字符串合并处理#
while True: try: s1, s2 = input().split() s = list(s1 + s2) #奇子串排序 s[::2] = sorted(s[::2]) #偶子串排序 s[1::2] = sorted(s[1::2]) dic = {'0':'0', '1':'8', '2':'4', '3':'C', '4&#...
0
点赞
评论
收藏
转发
1
2
3
工具箱
TA的圈子
暂未加入圈子
TA的圈子
TA的笔记
暂无笔记
TA的笔记
登录
0
天
已登录
0
天
连续登录
0
人
今日访客
牛客网
牛客企业服务