怎嘛错了??

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

AC_notonlyAC @ 2021-07-29 18:26:00

#include<bits/stdc++.h>
using namespace std;
double dis(double x1,double x2,double y1,double y2)
{
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main()
{
    double x1,x2,x3,y1,y2,y3,c=0;
    cin>>x1>>y1>>x2>>y2>>x3>>y3;
    c+=dis(x1,y1,x2,y2)+dis(x1,y1,x3,y3)+dis(x3,y3,x2,y2);
    printf("%.2lf",c);

}

by AC_notonlyAC @ 2021-07-29 18:27:17

0分

困难啊


by zr太弱了 @ 2021-07-29 18:28:00

没有return 0评测姬看起来不舒服


by tribool4_in @ 2021-07-29 18:28:45

建议重写 dis 函数,您的参数是什么玩意


by MatrixGroup @ 2021-07-29 18:44:10

@孔博溪NB 参数顺序反了


by juruojjl_ @ 2021-07-29 18:49:24

@孔博溪NB y1警告


by juruojjl_ @ 2021-07-29 18:52:33

还有,x1 x2反了

审题,请


by Zvelig1205 @ 2021-07-29 19:20:01

@孔博溪NB

double dis(double x1,double x2,double y1,double y2)
dis(x1,y1,x2,y2)
dis(x1,y1,x3,y3)
dis(x3,y3,x2,y2)

顺序有误


by _z_z_h @ 2021-07-29 19:20:09

我记得y1好像是c++的函数吧


|