标签:
由四个实数组成的坐标,全部变量用double,刚开始用整数没过
#include<stdio.h> #include<math.h> int main() { double a,b,c,d; double r; while(scanf("%lf%lf%lf%lf",&a,&b,&c,&d)!=EOF) { r=sqrt((a-c)*(a-c)+(b-d)*(b-d)); printf("%.2f\n",r); } return 0; }
标签:
原文地址:http://www.cnblogs.com/RocSAMA/p/5554887.html