From 7a56a690a960142b3cd0d1d5e9049d8c4a6d565e Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Mon, 28 Sep 2020 20:49:17 +0800 Subject: [PATCH] CF6A Triangle R38989380 --- problem/CF6A/CF6A.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 problem/CF6A/CF6A.cpp diff --git a/problem/CF6A/CF6A.cpp b/problem/CF6A/CF6A.cpp new file mode 100644 index 00000000..1b6bd827 --- /dev/null +++ b/problem/CF6A/CF6A.cpp @@ -0,0 +1,21 @@ +// R38989380 + +#include + +using namespace std; + +int main() { + int a, b, c, d; + cin >> a >> b >> c >> d; + // abc abd acd bcd + if (a + b > c && a + c > b && b + c > a || a + b > d && a + d > b && b + d > a || a + c > d && a + d > c && c + d > a || b + c > d && b + d > c && c + d > b) { + cout << "TRIANGLE" << endl; + } + else if (a + b >= c && a + c >= b && b + c >= a || a + b >= d && a + d >= b && b + d >= a || a + c >= d && a + d >= c && c + d >= a || b + c >= d && b + d >= c && c + d >= b) { + cout << "SEGMENT" << endl; + } + else { + cout << "IMPOSSIBLE" << endl; + } + return 0; +}