Skip to content

Commit 86e2b3b

Browse files
Update TriangleEverywhere.cpp
1 parent 25f5050 commit 86e2b3b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Codechef Problems/DSA Learning Series/TriangleEverywhere.cpp

+46
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,52 @@
22
Now If these three sides can form an Equilateral Triangle then print 1, if these three sides can form an Isosceles Triangle then print 2,
33
if these three sides can form a Scalene Triangle then print 3, otherwise print −1.*/
44

5+
/* Input:
6+
7+
· First-line will contain three numbers a, b, and c separated by space.
8+
9+
Output:
10+
11+
Print the answer in a new line.
12+
13+
Constraints
14+
15+
· 1≤a,b,c≤103
16+
17+
Sample Input 1:
18+
19+
2 4 3
20+
21+
Sample Output 1:
22+
23+
3
24+
25+
Sample Input 2:
26+
27+
4 4 4
28+
29+
Sample Output 2:
30+
31+
1
32+
33+
Sample Input 3:
34+
35+
4 4 9
36+
37+
Sample Output 2:
38+
39+
-1
40+
41+
EXPLANATION:
42+
43+
· In the first example, (2, 4, 3) will form a Scalene Triangle.
44+
45+
· In the second example, (4, 4, 4) will form an Equilateral Triangle.
46+
47+
· In the third example, (4, 4, 9) will not form a triangle.
48+
49+
*/
50+
551

652
#include <iostream>
753
using namespace std;

0 commit comments

Comments
 (0)