结果显示只有80分,不知道哪里出现问题

P5735 【深基7.例1】距离函数

sl2024005602 @ 2024-12-19 22:42:55

import math

def length(x,y,z,o):
    k=pow(y-x,2)
    l=pow(o-z,2)
    s=math.sqrt(k+l)
    return s

u=0
num1,num2=map(int,input().split(" "))
num3,num4=map(int,input().split(" "))
num5,num6=map(int,input().split(" "))
a=length(num1,num3,num2,num4)
b=length(num1,num5,num2,num6)
c=length(num3,num5,num4,num6)
u=a+b+c
print(f"{u:.2f}")

by wangshengchen @ 2024-12-26 21:42:15

@sl2024005602

坐标值是 实数(float)


by wangshengchen @ 2024-12-26 21:42:58

求关


|