看不懂为什么y1一直过不去?求助大佬

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

ForgetHer @ 2022-08-31 21:28:56

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

by ivyjiao @ 2022-08-31 21:31:07

y1 是函数名


by ivyjiao @ 2022-08-31 21:32:53

@EDang20001 加一句


#define y1 shenmelajiCjiajialiany1douburangyong

by ForgetHer @ 2022-08-31 21:33:03

@ivyjiao 大佬能不能靠换头文件使它正常通过


by ivyjiao @ 2022-08-31 21:34:05

@EDang20001 不行吧


by ForgetHer @ 2022-08-31 21:35:15

@ivyjiao 只能把变y1换了吗?


by ivyjiao @ 2022-08-31 21:36:57

@EDang20001 sqrt函数是cmath的

我先下线了


by Failure_Terminator @ 2022-08-31 21:37:11

@EDang20001 yl(doge


by ForgetHer @ 2022-08-31 21:38:50

@haimo %,属实麻了


|