题解 | 绕距
绕距
https://www.nowcoder.com/practice/7a245fc6284f4139b4fb21de58e68483
from math import sqrt x_1,y_1 = input().split() x_2,y_2 = input().split() x_1 = float(x_1) x_2 = float(x_2) y_1 = float(y_1) y_2 = float(y_2) d_e = ((x_1-x_2) ** 2+(y_1-y_2)**2) ** (1/2) d_m = abs(x_1 - x_2) + abs(y_1 - y_2) delt = abs(float(d_e) - float(d_m)) print(delt)
查看26道真题和解析