【深基7.例1】距离函数 - 洛谷
"""
P5735 【深基7.例1】距离函数(python3实现)
https://www.luogu.com.cn/problem/P5735
"""
import math
def dis(x1,y1,x2,y2):
return math.sqrt( (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2) )
x1,y1=list(map(float,input().split() ) )
x2,y2=list(map(float,input().split() ) )
x3,y3=list(map(float,input().split() ) )
dis1=dis(x1,y1,x2,y2)
dis2=dis(x2, y2, x3, y3)
dis3= dis(x3, y3, x1, y1)
ans=dis1+dis2+dis3
print("%.2f"%ans)
《深入浅出程序设计竞赛 - 基础篇》题单 https://www.luogu.com.cn/blog/177435/IPC-problems
P5703 【深基2.例5】苹果采购(python3实现) https://blog.csdn.net/dllglvzhenfeng/article/details/122690555
P5703 【深基2.例5】苹果采购(python3实现)--2022.01.29 https://blog.csdn.net/dllglvzhenfeng/article/details/122745163
P5704 【深基2.例6】字母转换(python3实现) https://blog.csdn.net/dllglvzhenfeng/article/details/122690663
P5704 【深基2.例6】字母转换(python3实现)-2022.01.29 https://blog.csdn.net/dllglvzhenfeng/article/details/122745360
P5705 【深基2.例7】数字反转(python3实现)方法一 https://blog.csdn.net/dllglvzhenfeng/article/details/122691059
P5705 【深基2.例7】数字反转(python3实现)方法二 https://blog.csdn.net/dllglvzhenfeng/article/details/122691194 ?
|