# include "stdio.h"
# include "math.h"
float length(int a,int b,int c,int d);
int main(void)
{
int a[3][2],i;
float perimeter=0,l1,l2,l3;
for(i=0;i<3;i++)//输入三边坐标
{
scanf("%d%d",&a[i][0],&a[i][1]);
}
l1=length(a[0][0],a[0][1],a[1][0],a[1][1]);
l2=length(a[1][0],a[1][1],a[2][0],a[2][1]);
l3=length(a[0][0],a[0][1],a[2][0],a[2][1]);
perimeter=l1+l2+l3;
printf("%.2f",perimeter);
}
float length(int a,int b,int c,int d)
{
float z;
z=sqrt((a-c)*(a-c)+(b-d)*(b-d));
return (z);
}
第五个错了,求教