代码如下: #include<stdio.h> #include<math.h> int main(){
float x1,y1,x2,y2; printf("请输入两个点的坐标:"); scanf("%f%f%f%f",&x1,&y1,&x2,&y2); float d = sqrt(pow((x1-x2),2)+pow((y1-y2),2));//sqrt开方,pow次方 printf("%.2f",d); return 0;
} 运行结果: 加群加强学习!!