'commit'
This commit is contained in:
24
TangDou/LuoGuBook/P5717.cpp
Normal file
24
TangDou/LuoGuBook/P5717.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user