Assignment #119 and Number Puzzles IV: A New Hope

Code

///John Mulligan
///period 5
///Program Name: NumberPuzzles4
///File Name: NumberPuzzles4.java

    public class NumberPuzzles4
    {
        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++)
                        {
                            int e = a + b + c + d;
                            
                            if ( e == 45 )
                            {
                                if ( a+2 == b-2 && b-2 == c*2 && c*2 == d/2 )
                                    System.out.println( a + " " + b + " " + c + " " + d );
                            }
                        }
        }
    }