#1WA了,找不出原因
查看原帖
#1WA了,找不出原因
344509
二分之一如梦楼主2020/5/12 12:52
#include<iostream>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    for (int k = 1; k <= 2; k++)
        for (int t, i = 1; i <= 2; i++)
        {
            if (a > b)
            {
                t = a;
                a = b;
                b = t;
            }
            if (b > c)
            {
                t = b;
                b = c;
                c = t;
            }
        }
    if(a+b<=c)
        cout<<"Not triangle"<<endl;
    else
    {
        if(a*a+b*b==c*c)
            cout<<"Right triangle"<<endl;
        if(a*a+b*b>c*c)
            cout<<"Acute triangle"<<endl;
        if(a*a+b*b<c*c)
            cout<<"Obtuse triangle"<<endl;
        if(a==b&&a==c)
            cout<<"Equilateral triangle"<<endl;
        else if(a==b||b==c)
            cout<<"Isosceles triangle"<<endl;
    }
    return 0;
}
2020/5/12 12:52
加载中...