思路:用pow函数计算,并且分开两步,比较简洁
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int main()
{
double x,y,m,n,c;
while(scanf("%lf %lf %lf %lf",&x,&y,&m,&n)!=EOF)
{
c=pow(x-m,2)+pow(y-n,2);
c=pow(c,0.5);
printf("%.2lf
",c);
}
return 0;
}