成功地编译失败,悬棺

P5735 【深基7.例1】距离函数

_mei_tou_nao_ @ 2024-08-19 13:28:59


using namespace std;
double a, b, c, d, x1, y1, x2, y2, x3, y3;

int main() {
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    a = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
    b = sqrt(pow(x3 - x1, 2) + pow(y3 - y1, 2));
    c = sqrt(pow(x3 - x2, 2) + pow(y3 - y2, 2));
    d = a + b + c;
    cout << fixed << setprecision(2) << d;
    return 0;
}

by _mei_tou_nao_ @ 2024-08-19 13:29:31

补一个万能头文件


by dongzirui0817 @ 2024-08-19 13:31:30

@_mei_tounao 补头文件就没事了吧


by _mei_tou_nao_ @ 2024-08-19 13:32:19

这边有头文件的


by _mei_tou_nao_ @ 2024-08-19 13:32:35

还是编译失败


by BVV_d_ @ 2024-08-19 13:33:03

等一个WA


by _mei_tou_nao_ @ 2024-08-19 13:33:27

????


by BVV_d_ @ 2024-08-19 13:33:46

@_mei_tounao 把你最新的发出来看下


by sapo1o @ 2024-08-19 13:34:18

@_mei_tounao 你的是什么头文件


by _xjx_ @ 2024-08-19 13:35:01

看一看有没有全角符号@_mei_tounao


by _czx6666_ @ 2024-08-19 13:35:08

#include<bits/stdc++.h>
using namespace std;
double a, b, c, d, x1, y01, x2, y02, x3, y03;

int main() {
    cin >> x1 >> y01 >> x2 >> y02 >> x3 >> y03;
    a = sqrt(pow(x2 - x1, 2) + pow(y02 - y01, 2));
    b = sqrt(pow(x3 - x1, 2) + pow(y03 - y01, 2));
    c = sqrt(pow(x3 - x2, 2) + pow(y03 - y02, 2));
    d = a + b + c;
    cout << fixed << setprecision(2) << d;
    return 0;
}

@_mei_tounao


| 下一页