Description
大家高中肯定都计算过空间几何中点与点之间的距离,现在要求编写程序计算出两个点之间的距离。给出代码 如下,提交时只需提交你编写的代码
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*
在此处编写你的代码
*/
int main(){
struct point p1,p2;
scanf("%d%d%d",&p1.x,&p1.y,&p1.z);
scanf("%d%d%d",&p2.x,&p2.y,&p2.z);
printf("%.2f",getDistance(p1,p2));
}
Input
输入有两行,每一行三个整数,数之间使用空格分隔
Output
输出占一行,一个浮点小数 ,精确到小数点后两位
Sample Input
copy 1 1 1
1 1 1
Made by hxl.
Sample Output
0.00
HINT
只需要提交你编写的部分,题目给出的代码不需要提交 。 浮点数类型使用double。
不要忘记return s;