Skip to content

Commit 6bb85fd

Browse files
Create TriangleEverywhere.cpp
1 parent c3b61c4 commit 6bb85fd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int a, b, c;
7+
cin >> a >> b >> c;
8+
if (a + b > c && b + c > a && c + a > b)
9+
{
10+
if (a == b && b == c)
11+
cout << "1";
12+
else if (a == b || b == c || c == a)
13+
cout << "2";
14+
else
15+
cout << "3";
16+
}
17+
else
18+
cout << "-1";
19+
return 0;
20+
}

0 commit comments

Comments
 (0)