1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-09 19:19:07 +01:00
CodeWars/7kyu/is_this_a_triangle/solution.cpp

18 lines
411 B
C++
Raw Normal View History

namespace Triangle
{
bool isTriangle(int ia, int ib, int ic)
{
long long a = ia;
long long b = ib;
long long c = ic;
if (a == 0 || b == 0 || c == 0) return false;
else if (a == b && b == c) return true;
else if (a + b <= c) return false;
else if (a + c <= b) return false;
else if (b + c <= a) return false;
return true;
}
}