-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9.java
29 lines (29 loc) · 849 Bytes
/
9.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication2;
/**
*
* @author Daniyal Javani
*/
public class JavaApplication2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
for(int a = 1; a < 1000 ; a++){
for(int b = 1 ; b < 1000 ; b++){
for(int c = 1 ; c < 1000 ; c++){
if( Math.pow(a, 2) + Math.pow(b, 2) == Math.pow(c, 2) ){
if( (a + b + c) == 1000){
System.out.println(a * b * c);
System.exit(0);
}
}
}
}
}
}
}