Kx_Triumphs @ 2023-08-14 10:40:17
#include<bits/stdc++.h>
using namespace std;
const int B=0;
double x1,y1,x2,y2,x3,y3,ans;
void dis(double x_1,double y_1,double x_2,double y_2){
double t=pow(abs(x_2-x_1),2)+pow(abs(y_2-y_1),2);
ans=ans+sqrt(t);
}
int main(){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
dis(x1,y1,x2,y2);
dis(x1,y1,x3,y3);
dis(x2,y2,x3,y3);
printf("%.2lf",ans);
return 0;
}
/*
0 0
0 3
4 0
*/
by xuzihao123 @ 2023-08-14 10:41:29
@kai_xuan_m
不会啊
by xuzihao123 @ 2023-08-14 10:41:41
编译器的问题吧
by gongziwen @ 2023-08-14 10:42:23
@kai_xuan_m y1
by ssSSSss_sunhaojia @ 2023-08-14 10:52:28
你使用了万能头文件,y1
会被当成一个函数名,所以你应该把y1
换个变量名。
by Kx_Triumphs @ 2023-08-14 10:56:43
@ssSSSss_sunhaojia 知道了,谢谢