c语言求助,编译不通过
查看原帖
c语言求助,编译不通过
149769
Zkxxxv_h楼主2022/9/16 14:43
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
struct pair{
    double x, y;
};
double len(pair a, pair b){
    return sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int main()
{
    struct pair a, b, c;
    scanf("%lf%lf", &a.x, &a.y);
    scanf("%lf%lf", &b.x, &b.y);
    scanf("%lf%lf", &c.x, &c.y);
    printf("%.2lf", len(a, b) + len(a, c) + len(b, c));
    return 0;
}

2022/9/16 14:43
加载中...