xiaguoxin @ 2020-07-19 16:12:56
#include<bits/stdc++.h>
using namespace std;
struct wz
{
int x;
int y;
};
wz x,y,z;
double sum;
void juli(wz x,wz y)
{
sum+=sqrt((x.y-x.x)*(x.y-x.x)+(y.y-y.x)*(y.y-y.x));
return ;
}
int main()
{
cin>>x.x>>x.y>>y.x>>y.y>>z.x>>z.y;
if(x.x<0)x.x*=(-1);
if(x.y<0)x.x*=(-1);
if(y.x<0)x.x*=(-1);
if(y.y<0)x.x*=(-1);
if(z.x<0)x.x*=(-1);
if(z.y<0)x.x*=(-1);
juli(x,y);
juli(x,z);
juli(z,y);
printf("%.2lf\n",sum);
return 0;
}
by Hanriver @ 2020-07-19 16:14:37
x和y用double
by iMya_nlgau @ 2020-07-19 16:19:26
if(x.x<0)x.x*=(-1);
if(x.y<0)x.x*=(-1);
if(y.x<0)x.x*=(-1);
if(y.y<0)x.x*=(-1);
if(z.x<0)x.x*=(-1);
if(z.y<0)x.x*=(-1);
这是啥,,应该去掉
by iMya_nlgau @ 2020-07-19 16:20:45
@夏国鑫123456
by dzy2008 @ 2020-07-19 16:24:50
double
by xiaguoxin @ 2020-07-19 16:30:06
谢谢大佬们,AC了