zhs314159

计算两点间的距离

思路:用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\n",c);
}

return 0;
}

分类:

技术点:

相关文章:

  • 2021-04-25
  • 2022-02-16
  • 2022-01-23
  • 2022-02-05
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2022-02-02
  • 2022-01-01
  • 2021-12-01
  • 2022-01-25
  • 2021-12-21
相关资源
相似解决方案