当前位置:网站首页>[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;} 边栏推荐
猜你喜欢
随机推荐
Flink on yarn双流join问题分析+性能调优思路
flink cdc source支持redis 和es吗
超声波传感器(CHx01) 学习笔记 Ⅲ-API介绍
【回忆】奶奶的歌谣
生产计划体系完整解决方案(1) - 复杂大规模问题的分阶段规划
「硬核」labelme 图片中显示标签
This week's investment report: CeFi accumulates venture capital attraction
观点:灵魂绑定NFT和去中心化社会
go的堆内存结构分析
Weekend Sharing - About WeChat Ecological Changes and 5G
不同的 DAO 对世界带来的改变
数学分析_证明_两个重要极限(同济版本)
巴比特 | 元宇宙每日必读:连续七个季度出现亏损,Meta元宇宙部门Q2亏损28 亿美元,扎克伯格称这种情况可能会持续数年...
[Code Hoof Set Novice Village 600 Questions] Given an integer n, find all the values of x and y in floor(n/x)=y
Out of breath!After 23 years of operation, the former "China's largest e-commerce website" has turned yellow...
leetcode94 -- 二叉树的中序遍历
hihoCoder #1143 : 骨牌覆盖问题·一
hihoCoder#: 博弈游戏·Nim游戏
UNIX环境高级编程第三章
Swagger








