Assignemnt #120
Code
/// Name: Holden Ganch
/// Period: 7
/// Program Name: sixtieth Program
/// File Name: EnterPIN.java
/// Date Finished: 10/5/2015
import java.util.Scanner;
public class Hope
{
public static void main( String[] args ) throws Exception
{
Scanner kb = new Scanner (System.in);
for (int a = 0; a < 46; a++)
{
for (int b = 0; b < 46; b++)
{
for (int c = 0; c < 46; c++)
{
for (int d = 0; d < 46; d++)
{
int sum = a + b + c + d;
int x = a + 2;
int y = b - 2;
int z = c * 2;
int w = d / 2;
if (x == y && y == z && z == w && sum == 45)
{
System.out.println(a+", "+b+", "+c+", " +d);
}
}
}
}
}
}
}
Picture of the output