简单判断一下就可以了

大炼丹师

https://ac.nowcoder.com/acm/problem/54392

#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        int x[3];
        cin>>x[0]>>x[1]>>x[2];
        sort(x,x+3);
        if(x[0]==x[1]&&x[0]==x[2])
        {
            cout<<"equilateral"<<endl;
        }
        else if(x[0]*x[0]+x[1]*x[1]==x[2]*x[2])
        {
            cout<<"right"<<endl;
        }
        else if(x[0]+x[1]>x[2])
        {
            cout<<"normal"<<endl;
        }
        else
        {
            cout<<"error"<<endl;
        }
    }
}
全部评论

相关推荐

飞屋一号:包住还有每工作日餐补,已经比很多公司的实习强了吧
点赞 评论 收藏
分享
11-03 18:50
门头沟学院 Java
迷茫的大四🐶:问就是马上到,一周五天,6个月以上,全国可飞
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务