Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Day 2
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { double max; Scanner sc = new Scanner(System.in); double a = sc.nextDouble(); double b = sc.nextDouble(); double c = sc.nextDouble(); if (a <= 0 || b <= 0 || c <= 0 || a + b <= c || a + c <= b || c + b <= a) System.out.println("KHONG TAO THANH TAM GIAC "); else if (a == b && b == c) System.out.println("DAY LA TAM GIAC DEU"); else if (a == b || a == c || b == c) System.out.println("DAY LA TAM GIAC CAN"); else { if (a > b && a > c) { max = a; if (max*max - b*b - c*c == 0) System.out.println("DAY LA TAM GIAC VUONG"); else System.out.println("DAY LA TAM GIAC"); } else if (b > c) { max = b; if (max*max - a*a - c*c == 0) System.out.println("DAY LA TAM GIAC VUONG"); else System.out.println("DAY LA TAM GIAC"); } else { max = c; if (max*max - b*b - a*a == 0) System.out.println("DAY LA TAM GIAC VUONG"); else System.out.println("DAY LA TAM GIAC"); } } } }
run
|
edit
|
history
|
help
0
has a
DFS in Graph
linear search
j
1(E)
first activity
Java Array List
Application
"Naive" recursion vs. Dynamic Programming
Cyclically rotate array