计算两点间的距离
#include<stdio.h> #include<math.h> int main( ) { double x1,y1,x2,y2; while(scanf("%lf",&x1)!=EOF) { scanf("%lf%lf%lf",&y1,&x2,&y2); printf("%.2lf\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))); } return 0; }
posted on 2011-04-28 10:56 more think, more gains 阅读(142) 评论(0) 编辑 收藏 举报