#include <iostream>
#include <vector>
#include <string>
using namespace std;
void max(int& a, int& b, int& c)
{
int d;
if(a<b)
{
d = a;
a = b;
b = d;
}
// a max
if(a<c)
{
d = a;
a = c;
c = d;
}
}
void judge(int a, int b, int c, vector<string>& svec)
{
if(a<=0||b<=0||c<=0)
svec.push_back("is not a valid triangle.");
else
{
max(a, b, c);
if(a>=(b+c))
svec.push_back("is not a valid triangle.");
else
{
if(a*a==(b*b+c*c))
svec.push_back("is a right triangle.");
else if(a*a>(b*b+c*c))
svec.push_back("is a blunt triangle.");
else
svec.push_back("is a sharp triangle.");
}
}
}
int main()
{
int a,b,c;
vector<string> svec;
while(cin>>a>>b>>c)
judge(a, b, c, svec);
vector<string>::const_iterator iter = svec.begin();
int count = 1;
while(iter != svec.end())
cout<<"Case "<<count++<<": "<<*iter++<<endl;
return 0;
}
1817
最新推荐文章于 2022-04-21 08:05:11 发布