牛客989263876号
牛客989263876号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客989263876号的博客
全部文章
(共25篇)
题解 | 多组输入a+b II
n=int(input()) lists=[] result=[] res=0 for i in range(0,n): lst=list(map(int,input().split())) lists.append(lst) # print(lists) for lst in ...
2025-06-26
0
4
题解 | 多组数据a+b III
lists=[] res=0 condition=True while condition: lst=list(map(int,input().split())) lists.append(lst) if lst[0]==0 and lst[1]==0: co...
2025-06-25
0
7
题解 | 四季
month=int(input()[4:]) if month>=3 and month <=5: print("spring") elif month>=6 and month<=8: print("summer")...
2025-06-25
0
5
题解 | 最大最小值
x,y,z=map(int,input().split()) def max_min(a,b): if a>b: return (a,b) else: return (b,a) max1,min1=max_min(x,y) max,min2=...
2025-06-25
0
7
题解 | 成绩
scores=list(map(int,input().split())) weights=[0.2,0.3,0.5] result=0 for score,weight in zip(scores,weights): result+=score*weight print(int(resul...
2025-06-25
0
7
题解 | 计算机内存
import math n=int(input()) result=n*1024*1024/4 print(int(result)) # python中的除法是自动取浮点数的
2025-06-25
0
7
题解 | 绕距
import math x1,y1=map(int,input().split()) x2,y2=map(int,input().split()) d_e=math.sqrt(math.pow((x1-x2),2)+math.pow((y1-y2),2)) # math.pow(x,y)用来...
2025-06-25
0
8
题解 | 反向输出一个四位数
n=input() print(n[::-1]) #[::-1] 是一种反转序列(如列表、字符串、元组等)的切片操作 # 第一个:表示从序列的开头开始 # 第二个: 表示到序列的末尾结束 # -1 是步长,表示从后向前取元素
2025-06-25
0
5
题解 | 整数的十位
print(int(input())//10%10) # / 用于真除法,返回浮点数 # //用于地板除法,返回商的正数部分
2025-06-25
0
5
题解 | 整数的个位
print(int(input())%10) #余数的符号与除数一致
2025-06-25
0
6
首页
上一页
1
2
3
下一页
末页