A29739.三角形的周长题解
2025-12-23 21:36:20
发布于:江苏
8阅读
0回复
0点赞
看完后
点赞+加入团队
不按套路出牌的我:
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
double x1, y1, x2, y2, x3, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double d1 = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
double d2 = sqrt(pow(x3 - x2, 2) + pow(y3 - y2, 2));
double d3 = sqrt(pow(x1 - x3, 2) + pow(y1 - y3, 2));
double perimeter = d1 + d2 + d3;
cout << fixed << setprecision(2) << perimeter << endl;
return 0;
}
这里空空如也







有帮助,赞一个