文浅_e7 @ 2021-08-02 22:43:53
本地能过,但是提交就CE。。。
#include<bits/stdc++.h>
using namespace std;
#define pi 3.141
typedef long long ll;
#define N 100005
double x1,y1,x2,y2,x3,y3;
double s1,s2,s3;
double ans;
void init(){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
}
void work(){
s1=sqrt(pow((x2-x1),2)+pow((y2-y1),2));
s2=sqrt(pow((x3-x2),2)+pow((y3-y2),2));
s3=sqrt(pow((x3-x1),2)+pow((y3-y1),2));
ans=s1+s2+s3;
cout<<fixed<<setprecision(2)<<ans;
}
int main(int argc, char const *argv[])
{
init();
work();
return 0;
}
?
by BorisDimitri @ 2021-08-02 22:47:21
c++98 不支持定义变量为y1
把y1改成别的试试
by 文浅_e7 @ 2021-08-02 22:50:14
@BorisDimitri 谢谢,把y1改成y11就过了