為什麼re啊,本機測試都沒問題
查看原帖
為什麼re啊,本機測試都沒問題
354316
平凡的夜空楼主2020/6/24 20:41
import math as m
s=input().split()
for i in range(len(s)):
    s[i]=float(s[i])
#s[0] s[1] s[2] s[3] s[4] s[5]
x1=s[0]
x2=s[2]
x3=s[4]
y1=s[1]
y2=s[3]
y3=s[5]
def dis(x1,y1,x2,y2):
    return m.sqrt((x2-x1)**2+(y2-y1)**2)
print('%.2f' % (dis(x1,y1,x2,y2)+dis(x2,y2,x3,y3)+dis(x1,y1,x3,y3)))

2020/6/24 20:41
加载中...