社区讨论

大佬求救!50分...

P5717【深基3.习8】三角形分类参与者 3已保存回复 5

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
5 条
当前快照
1 份
快照标识符
@lo8yuo2f
此快照首次捕获于
2023/10/28 02:48
2 年前
此快照最后确认于
2023/10/28 02:48
2 年前
查看原帖
CPP
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a+b<c||a+c<b||b+c<a){
		cout<<"Not triangle";
		return 0;
	}
	if(a>b) swap(a,b);
	if(b>c) swap(b,c);
	if(a>b) swap(a,b);
	if(a*a+b*b==c*c) cout<<"Right triangle";
	else if(a*a+b*b>=c*c) cout<<"Acute triangle";
	else cout<<"Obtuse triangle";
	if(a==b) cout<<"Isosceles triangle";
	if(a==b&&a==c) cout<<"Equilateral triangle";
	cout<<endl;
	return 0;
}
错哪里了?大佬们帮忙看一下哈

回复

5 条回复,欢迎继续交流。

正在加载回复...