求助,为什么过不去qwq
查看原帖
求助,为什么过不去qwq
759274
Stevehim楼主2022/9/4 20:05
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;

struct node {
	double x;
	double y;
} a[3];

int main() {
	for (int i = 0; i < 3; i++) {
		cin >> a[i].x >> a[i].y;
	}
	double d1, d2, d3;
	d1 = sqrt(pow(a[2].x - a[1].x, 2) + pow(a[2].y - a[1].y, 2));
	d2 = sqrt(pow(a[3].x - a[2].x, 2) + pow(a[3].y - a[2].y, 2));
	d3 = sqrt(pow(a[1].x - a[3].x, 2) + pow(a[1].y - a[3].y, 2));
	printf("%.2lf", d1 + d2 + d3);
	return 0;
}

2022/9/4 20:05
加载中...