计算两点间的距离
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 120280 Accepted Submission(s): 45874
0 0 0 1 0 1 1 0
1.00 1.41
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
typedef float elemtype;
void main()
{
elemtype x1,y1,x2,y2;
while(scanf("%f %f %f %f",&x1,&y1,&x2,&y2) != EOF)
{
elemtype d;
d = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
printf("%.2f\n",d);
}
}
1180



被折叠的 条评论
为什么被折叠?



