哪错了?
查看原帖
哪错了?
796459
Jiangxh100315楼主2024/4/18 16:20
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int main(){
	cin>>a>>b>>c;
	if(a==b==c){
		cout<<"Acute triangle";
		cout<<"Isosceles triangle"<<endl;
		cout<<"Equilateral triangle"<<endl;
	}
	if(a==b||c!=a&&b==c||a!=c&&a==c||a!=b){
		int d=(a+b)/2,e=(a+c)/2,g=(b+c)/2;
		if(d<c||c!=sqrt(2)*a&&e<b||b!=sqrt(2)*c&&g<a||a!=sqrt(2)*b){
			cout<<"Obtuse triangle"<<endl;
		}
		if(d>c&&e>b&&g>a){
			cout<<"Acute triangle"<<endl;
		}
		if(c==sqrt(2)*a&&b==sqrt(2)*c&&a==sqrt(2)*b){
			cout<<"Right triangle"<<endl;
		}
		cout<<"Isosceles triangle"<<endl;
	}
	if(a*a+b*b==c*c&&b*b+c*c==a*a&&a*a+c*c==b*b){
		cout<<"Right triangle";
	}
	return 0;
}
2024/4/18 16:20
加载中...