标签:code span math.h stdio.h using #include while image 计算
注意:在C语言中,double->lf,结果保留两位小数->0.2lf
#include<stdio.h> #include<math.h> using namespace std; int main() { double x1,y1,x2,y2; char d; while(scanf("%lf%lf%lf%lf%c",&x1,&y1,&x2,&y2,&d)!=EOF) { double a; a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); printf("%.2lf\n",a); } }
标签:code span math.h stdio.h using #include while image 计算
原文地址:http://www.cnblogs.com/Strugglinggirl/p/5988937.html