来自洛谷网校:
https://www.luogu.com.cn/problem/P5717
这道题并不难。代码如下:
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a>b) swap(a,b);
if(a>c) swap(a,c);
if(b>c) swap(b,c);
if(a+b<c){
cout<<"Not triangle";
return 0;
}
if(a*a+b*b==c*c)
cout<<"Right triangle"<<endl;
else if(a*a+b*b>c*c)
cout<<"Acute triangle"<<endl;
else if(a*a+b*b<c*c)
cout<<"Obtuse triangle"<<endl;
if(a==b||b==c) cout<<"Isosceles triangle"<<endl;
if(a==b&&b==c) cout<<"Equilateral triangle";
return 0;
}