We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f1df0c commit dc9eb6eCopy full SHA for dc9eb6e
Pythagorean Triplets
@@ -0,0 +1,26 @@
1
+import java.util.*;
2
+
3
+ public class Main {
4
5
+ public static void main(String[] args) {
6
+ Scanner scn = new Scanner(System.in);
7
+ int a = scn.nextInt();
8
+ int b = scn.nextInt();
9
+ int c = scn.nextInt();
10
11
+ int max = a;
12
+ if(b >= max)
13
+ max = b;
14
15
+ if(c >= max)
16
+ max = c;
17
18
+ if(max == a){
19
+ System.out.println((b * b + c * c) == (a * a));
20
+ } else if(max == b){
21
+ System.out.println((a * a + c * c) == (b * b));
22
+ } else {
23
+ System.out.println((a * a + b * b) == (c * c));
24
+ }
25
26
0 commit comments