60分代码 佬帮我看下哪里错了

P5717 【深基3.习8】三角形分类

@[Wsm4321](/user/859372) sort写错了
by _Haoomff_ @ 2023-01-08 18:07:01


应该是 ```cpp sort(x+1,x+4+1) ``` 吧?
by _Haoomff_ @ 2023-01-08 18:08:07


@[_Haoomff_](/user/368111) 他是对的,他要排序a,b,c
by Loser_Syx @ 2023-01-08 18:11:49


@[Wsm4321](/user/859372) 个人感觉是输出完Not triangle之后要return 0
by Loser_Syx @ 2023-01-08 18:13:32


@[Saint_ying_xtf](/user/852144) 对的,眼瞎了
by _Haoomff_ @ 2023-01-08 18:15:48


@[Wsm4321](/user/859372) 楼上的楼上正解
by _Haoomff_ @ 2023-01-08 18:16:09


@[Wsm4321](/user/859372) 能AC
by Loser_Syx @ 2023-01-08 18:41:43


@[Saint_ying_xtf](/user/852144) ac不了 sort后面那个加1也ac不了
by Wsm4321 @ 2023-01-08 18:51:32


@[Wsm4321](/user/859372) sort后面不要加一
by Loser_Syx @ 2023-01-08 19:02:12


@[Wsm4321](/user/859372) 你交这个代码 ```cpp #include<iostream> #include<cmath> #include<algorithm> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; int x[4]={0,a,b,c}; sort(x+1,x+4); int d=sqrt(x[1]*x[1]+x[2]*x[2]); int e=sqrt(x[3]*x[3]); if(x[1]+x[2]<=x[3]){ cout<<"Not triangle"<<endl; return 0; } if(d==e){ cout<<"Right triangle"<<endl; } if(d>e){ cout<<"Acute triangle"<<endl; } if(d<e){ cout<<"Obtuse triangle"<<endl; } if(a==b||a==c||b==c){ cout<<"Isosceles triangle"<<endl; } if(a==b&&a==c){ cout<<"Equilateral triangle"<<endl; } } ```
by Loser_Syx @ 2023-01-08 19:02:54


| 下一页