我的天哪。。。第五个测试点过不去,求出大佬,来看看我的代码
查看原帖
我的天哪。。。第五个测试点过不去,求出大佬,来看看我的代码
291838
小鸟飞飞飞楼主2020/5/30 17:14
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int a,b,c;
	cin >> a >> b >> c;
	if(a+b<=c||a+c<=b||c+b<=a)
	{
		cout << "Not triangle"; 
	}
	else
	{
		if((a*a)+(b*b)==(c*c))
		{
			if(a==b||b==c||c==a)
			{
				cout << "Right triangle" << endl;
				cout << "Isosceles triangle" << endl;
			}
			else
			{
				cout << "Right triangle" << endl;
			}
		}
		else if((a*a)+(b*b)>=(c*c))
		{
			if(a==b||b==c||c==a)
			{
				if(a==b&&b==c&&a==c)
				{
					cout << "Acute triangle" << endl;
					cout << "Isosceles triangle" << endl;
					cout << "Equilateral triangle" << endl;
				}
				else
				{
					cout << "Acute triangle" << endl;
					cout << "Isosceles triangle" << endl;
				}
			}
			else
			{
				cout << "Acute triangle" << endl;
			}
		}
		else if((a*a)+(b*b)<=(c*c))
		{
			if(a==b||b==c||c==a)
			{
				if(a==b&&b==c&&c==a)
				{
					cout << "Obtuse triangle" << endl;
					cout << "Isosceles triangle" << endl;
					cout << "Equilateral triangle" << endl;
				}
				else
				{
					cout << "Obtuse triangle" << endl;
					cout << "Isosceles triangle" << endl;
				}
			}
			else
			{
				cout << "Obtuse triangle" << endl;
			}
		}
	}
	return 0;
}
2020/5/30 17:14
加载中...