求助:两个点没过,为啥呀
查看原帖
求助:两个点没过,为啥呀
456769
hgcyy楼主2021/2/9 17:30
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	
int a,b,c;
cin>>a>>b>>c;
int k[3]={a,b,c};
sort(k,k+3);

	if(k[0]+k[1]>k[2]){
		if(k[0]==k[1] || k[1]==k[2] ||k[0]==k[2]) cout<<"Isosceles triangle\n";
		if(k[0]==k[2] && k[0]==k[1]) cout<<"Equilateral triangle\n";
		if(k[0]*k[0]+k[1]*k[1]==k[2]*k[2])cout<<"Right triangle";
		if(k[0]*k[0]+k[1]*k[1]<k[2]*k[2]) cout<<"Obtuse triangle";
		if(k[0]*k[0]+k[1]*k[1]>k[2]*k[2]) cout<<"Acute triangle";
	}
	else{
		cout<<"Not triangle";
	}
	
	return 0;
}
2021/2/9 17:30
加载中...