简单粗暴点
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void main()
{
double x1,y1,z1,x2,y2,z2;
double leng,disn1,disn2,disn3;
printf("输入两点的三维坐标:\n");
printf("x1=");
scanf("%lf",&x1);
printf("y1=");
scanf("%lf",&y1);
printf("z1=");
scanf("%lf",&z1);
printf("\n");
printf("x2=");
scanf("%lf",&x2);
printf("y2=");
scanf("%lf",&y2);
printf("z2=");
scanf("%lf",&z2);
disn1 = (x1-x2)*(x1-x2);
disn2 = (y1-y2)*(y1-y2);
disn3 = (z1-z2)*(z1-z2);
leng = sqrt(disn1 + disn2 + disn3);
printf("两点的距离为%lf",leng);
}