H.Y Wang 提交的代码
提交时间:2021年2月5日 12:23 语言:C++运行时间:0ms占用内存:276K
运行状态: Accepted
题目:判断三角形类型1351

大会员可查看代码,点此开通大会员

                
                    #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <unordered_map>
using namespace std;

int main() {
    int a(0), b(0), c(0);
    while (cin >> a >> b >> c) {
        int big = max(a, max(b, c));
        int small = min(a, min(b, c));
        int middle = a + b + c - big - small;
        if (pow(big, 2) == pow(small, 2) + pow(middle, 2)) {
            cout << "直角三角形" << endl;
        } else if (pow(big, 2) > pow(small, 2) + pow(middle, 2)) {
            cout << "钝角三角形" << endl;
        } else {
            cout << "锐角三角形" << endl;
        }
    }
    return 0;
}