Accepted
Code
#include <bits/stdc++.h>
using namespace std;
void solve(int cs) {
int a[3];
for (int i = 0; i < 3; i++) cin >> a[i];
sort(a, a + 3);
if (a[0] + a[1] > a[2]) {
if (a[0] == a[1] && a[1] == a[2]) {
cout << "Equilateral\n";
} else if (a[0] == a[1] || a[1] == a[2]) {
cout << "Isosceles\n";
} else {
cout << "Scalene\n";
}
} else {
cout << "Not a triangle\n";
}
}
int32_t main() {
ios::sync_with_stdio(!cin.tie(0));
int t = 1;
// cin >> t;
for (int i = 1; i <= t; ++i) {
solve(i);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1108 Triangle Triangle Triangle!!!
- Contest
- Brain Booster #8
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-02-17 14:34:22
- Judged At
- 2025-02-17 14:34:22
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB