C语言一下程序为什么运行不了?

2025-04-15 07:04:10
推荐回答(1个)
回答1:

你好,scanf中的变量前面需要加&
#include
#include
int main()
{
double x1,y1,x2,y2,a;
scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
a=sqrt(pow(x1-x2,2)+pow(y1-y2,2));
printf("%.2f",a);
return 0;
}