题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2001
注意输入时候的空格就可以了
#include<stdio.h> #include<math.h> int main() { double x1,x2,y1,y2; while(scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2)!=EOF) { getchar(); printf("%.2f\n",sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))); } }
时间: 2024-08-15 14:27:02