| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
计算两点间的距离,我的程序问题到底出在哪里??#include <stdio.h>
#include <math.h>
int main()
{
float x1,y1,x2,y2,a,b;
while(scanf("%f%f%f%f",x1,y1,x2,y2)!=EOF)
{
a=(x2-x1)*(x2-x1);
b=(y2-y1)*(y2-y1);
printf("%.2f\n",sqrt(a+b));
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator