当前位置:网站首页>[Code Hoof Set Novice Village 600 Questions] Find the distance between two points in the space rectangular coordinate system
[Code Hoof Set Novice Village 600 Questions] Find the distance between two points in the space rectangular coordinate system
2022-07-29 18:33:00 【Sandm *】
Title link:
Code Foot Collection (matiji.net)
Things to solve the problem:
The function sqrt() is examined,
You can create another variable x to store the data of x1 - x2,
This makes it easier to code the following x * x
Reference code:
#includeusing namespace std;int main( ){int x1=0,y1=0,z1=0;int x2=0,y2=0,z2=0;;/*cin >> x1 >>" ">> y1 >>" ">>z1;cin >> x2 >>" ">> y2 >>" ">>z2;*/cin >> x1 >> y1 >> z1;cin >> x2 >> y2 >> z2;double x = x1-x2;double y = y1 - y2;double z = z1 - z2;double sum = sqrt(x*x+y*y+z*z);printf("%.2lf",sum);return 0;} 边栏推荐
猜你喜欢
随机推荐
「记录」MMDetection入门篇
解决报错Unsupported field: HourOfDay
Analyst: Baidu could become China's most valuable company by 2030
Mathematical Analysis_Proof_Two Important Limits (Tongji Version)
地球超2亿蛋白质结构全预测,AlphaFold引爆「蛋白质全宇宙」
This week's investment report: CeFi accumulates venture capital attraction
泰山OFFICE技术讲座:影响文字效果的因素,由四大升级为五大
Chapter 7 XGBoost
译文推荐 | 调试 BookKeeper 协议 - 无界 Ledger
leetcode141 -- 环形链表
银行有没有必要建立数据中台?看完你就明白了
Route ISIS
crontab执行定时任务报错的问题
QMI8658 - 6轴传感器学习笔记
刚刚,60后复旦校友IPO敲钟:市值400亿
详解析构函数、拷贝构造函数
牛血清白蛋白-葡聚糖纳米颗粒包埋蛋清源活性肽/葡聚糖共价接枝物的制备
不同的 DAO 对世界带来的改变
一文搞定代码中的命名
go协程栈底层讲解









