首页
技术博客
登录
6mi
u
盘
搜
搜 索
技术博客
用python来解PAT乙级1063计算谱半径-20-满分
用python来解PAT乙级1063计算谱半径-20-满分
tech
2025-04-03
14
同样的这题没什么好讲的,按照输入求每一个模,然后输出最大的一个就是谱半径
代码:
from math import sqrt n = int(input()) l = [] for i in range(n): num = [int(i) for i in input().split()] l.append(sqrt(num[0] ** 2 + num[1] ** 2))#求模,放入列表 print('{:.2f}'.format(max(l)))#输出最大模
提交结果:
转载请注明原文地址:https://tech.qufami.com/read-21388.html
最新回复
(
0
)