60分求助大佬
查看原帖
60分求助大佬
374722
gongchuqiao楼主2021/6/6 16:48

dalao帮忙看看哪儿错了,我眼有点瞎。

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

int main()
{
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    if (a + b <= c || b + c <= a || c + a <= b)
    {
        printf("Not triangle");
        return 0;
    }
    if (a * a + b * b == c * c || c * c + a * a == b * b || c * c + b * b == a * a)
    {
        printf("Right triangle");
        printf("\n");
    }
    if (a * a + b * b > c * c || c * c + a * a > b * b || c * c + b * b > a * a)
    {
        printf("Acute triangle");
        printf("\n");
    }
    if (a * a + b * b < c * c || c * c + a * a < b * b || c * c + b * b < a * a)
    {
        printf("Obtuse triangle");
        printf("\n");
    }
    if (a == b || b == c || c == a)
    {
        printf("Isosceles triangle");
        printf("\n");
    }
    if (a == b && b == c)
    {
        printf("Equilateral triangle");
        printf("\n");
    }
    return 0;
}
2021/6/6 16:48
加载中...