中级天翼
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a>c) swap(a,c);if(b>c) swap(b,c);if(a>b) swap(a,b);
if(a+b<=c){
cout<<"Not triangle";
}else if(a*a+b*b==c*c) cout<<"Right triangle";
else if(a*a+b*b>c*c) cout<<"Acute triangle";
else if(a*a+b*b<c*c) cout<<"Obtuse triangle";
else if(a==b||a==c||b==c) cout<<"Isosceles triangle";
else if(a==b&&b==c) cout<<"Equilateral triangle";
return 0;
}
黄依成在2020-07-21 09:09:16追加了内容
红绿相间
黄依成在2020-07-21 09:11:21追加了内容
分享图片,我个人主页里的
黄依成在2020-07-21 10:12:50追加了内容
好吧,标题是骗你进来的o(* ̄︶ ̄*)o
洛谷5717
新手光能
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a+b<=c||a+c<=b||c+b<=a)cout<<"Not triangle";
else{
if(a>=b&&a>=c){
if(a*a==c*c+b*b)cout<<"Right triangle\n";
if(a*a>c*c+b*b)cout<<"Acute triangle\n";
if(a*a<c*c+b*b)cout<<"Obtuse triangle\n";
}
else if(b>a&&b>c){
if(a*a+c*c==b*b)cout<<"Right triangle\n";
if(a*a+c*c>b*b)cout<<"Acute triangle\n";
if(a*a+c*c<b*b)cout<<"Obtuse triangle\n";
}
else if(c>a&&c>b){
if(a*a+b*b==c*c)cout<<"Right triangle\n";
if(a*a+b*b>c*c)cout<<"Acute triangle\n";
if(a*a+b*b<c*c)cout<<"Obtuse triangle\n";
}
if(a==b&&b==c)cout<<"Equilateral triangle\n";
else if(a==b||a==c||b==c)cout<<"Isosceles triangle\n";
}
return 0;
}
你是不是没换行呀?
还是没ac?
新手光能
朱瑾文在2020-07-21 10:46:52追加了内容
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a+b<=c||a+c<=b||c+b<=a)cout<<"Not triangle";
else{
if(a>=b&&a>=c){
if(a*a==(c+b)*(c+b))cout<<"Right triangle";
if(a*a>c*c+b*b)cout<<"Acute triangle";
if(a*a<c*c+b*b)cout<<"Obtuse triangle";
}
else if(b>a&&b>c){
if(a*a+c*c==b*b)cout<<"Right triangle";
if(a*a+c*c>b*b)cout<<"Acute triangle";
if(a*a+c*c<b*b)cout<<"Obtuse triangle";
}
else if(c>a&&c>b){
if(a*a+b*b==c*c)cout<<"Right triangle";
if(a*a+b*b>c*c)cout<<"Acute triangle";
if(a*a+b*b<c*c)cout<<"Obtuse triangle";
}
if(a==b||a==c||b==c)cout<<"Isosceles triangle";
if(a==b&&b==c)cout<<"Equilateral triangle";
}
return 0;
}