dlmm @ 2021-09-07 21:51:27
#include<bits/stdc++.h>
using namespace std;
float sq(int ax,int ay,int bx,int by){
return sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
}
int main(){
float ax,ay,bx,by,cx,cy;
scanf("%f%f%f%f%f%f",&ax,&ay,&bx,&by,&cx,&cy);
float ab=sq(ax,ay,bx,by),ac=sq(ax,ay,cx,cy),bc=sq(bx,by,cx,cy);
float c=ab+ac+bc;
printf("%.2f",c);
return 0;
}
我也不知道错哪了,各位dalao求助
by wzj33300 @ 2021-09-07 21:55:47
double
by 已注销yj!gBUM @ 2021-09-07 21:57:19
@dlmm 请改用double数据类型
by dlmm @ 2021-09-07 21:59:50
用double也是错的T_T
by Always_Remember_It @ 2021-09-07 22:08:38
@dlmm
float sq(int ax,int bx,int ay,int by)
里面用float
by dlmm @ 2021-09-07 22:13:47
已经过了,感谢dalao。