# 80十分,怎么AC呢?在此拜谢大佬指点! #
查看原帖
# 80十分,怎么AC呢?在此拜谢大佬指点! #
259804
Taoyaoyao123楼主2020/4/29 16:07
#include<iostream>
#include<algorithm>
using namespace std;
main(){
	int a,b,c;
	int temp1,temp2,temp3;
	cin>>a>>b>>c;
	temp1=min(min(a,b),c);
	temp3=max(max(a,b),c);
	temp2=a+b+c-temp1-temp3;
	a=temp1;
	b=temp2;
	c=temp3;
	if(c>=b+a){
		cout<<"Not triangle"<<endl;
	}else{
		if(c*c==b*b+a*a){
			cout<<"Right triangle"<<endl;
			if(b==a){
				cout<<"Isosceles triangle"<<endl;
			} 
		}else if(c*c<=b*b+a*a){
			cout<<"Acute triangle"<<endl;
			if(b==a&&b!=c||b==c&&b!=a){
				cout<<"Isosceles triangle"<<endl;
				if(b==a&&b==c){
					cout<<"Equilateral triangle"<<endl;
				}
			}
		}else if(c*c>=b*b+a*a){
			cout<<"Obtuse triangle"<<endl;
			if(a==b){
				cout<<"Isosceles triangle"<<endl;
			}
		}
	}
}
2020/4/29 16:07
加载中...