Assignemnt #119 and Number Puzzles IV: A New Hope
Code
/// Name: Brian Phillips
/// Period: 5
/// Program name: Number Puzzles IV: A New Hope
/// File Name: Puzzles4.java
/// Date Finished: 5/8/2016
public class Puzzles4
{
public static void main(String[] args)
{
for (int a = 1; a < 100; a++)
for (int b = 1; b < 100; b++)
for (int c = 1; c < 100; c++)
for (int d = 1; d < 100; d++)
{
if (a + b + c + d == 45 && a+2 == b-2 && a+2 == c*2 && a+2 == d/2.0)
System.out.println(a + " " + b + " " + c + " " + d);
}
}
}
Picture of the output