You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
926 B
24 lines
926 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int x, y, z;
|
|
|
|
int main() {
|
|
cin >> x >> y >> z;
|
|
int d[4] = {0, x, y, z};
|
|
sort(d + 1, d + 3 + 1);
|
|
|
|
if (d[1] + d[2] <= d[3]) {
|
|
printf("Not triangle\n");
|
|
return 0;
|
|
}
|
|
if (d[1] * d[1] + d[2] * d[2] == d[3] * d[3]) printf("Right triangle\n"); //直角三角形
|
|
//在一个三角形中,如果较短的两条边的平方和大于最长边的平方,那么这个三角形是锐角三角形,否则它是钝角三角形。
|
|
else if (d[1] * d[1] + d[2] * d[2] > d[3] * d[3]) printf("Acute triangle\n");//锐角三角形
|
|
else if (d[1] * d[1] + d[2] * d[2] < d[3] * d[3]) printf("Obtuse triangle\n");//钝角三角形
|
|
|
|
if (d[1] == d[2]) printf("Isosceles triangle\n");//等腰三角形
|
|
if (d[1] == d[2] && d[1] == d[3] && d[2] == d[3]) printf("Equilateral triangle\n");//等边三角形
|
|
return 0;
|
|
} |