c++

zzr001 2021-04-16 15:46:30 0

c++判断是不是三角形怎么做? 在线求助

{{ vote && vote.total.up }}

共 3 条回复

zzr001

DZM AK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

JupHamaster 木星拜
#include <bits/stdc++.h>
using namespace std;
int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a + b > c and a + c > b and c + b > a) {
        if (a == b and a == c and b == c)
            cout << "It is a equilateral triangle.";
        else if (a == b or a == c or c == b)
            cout << "It is a isoceles triangle.";
        else
            cout << "It is a common triangle.";
    } else
        cout << "It is not a triangle.";

    return 0;
}
JupHamaster 木星拜

zzr AK IOI!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!