Assignemnt #119 Number Puzzles

Code

    ///Name: Joshua Pell
    ///Period: 6
    ///Project Name: Number Puzzles
    ///File Name: numPuzzles.java
    ///Date: 5/31/2015
    
public class numPuzzlesIV
{
        public static void main( String[] args )
        {
                for ( int a = 1; a < 45; a++ )
                {
                        for ( int b = 1; b < 45; b++ )
                        {
                                for (int c = 1; c < 45; c++ )
                                {
                                        for ( int d = 1; d < 45; d++ )
                                        {
                                                if ( (a + b + c + d) == 45 )
                                                {
                                                        int e = a + 2, f = b - 2, g = c * 2, h = d/ 2;
                                                        
                                                        if ( e == f )
                                                        {
                                                            if ( f == g )
                                                            {
                                                                if (g == h )
                                                                    System.out.println( "A is: " + a + " B is: " + b + " C is: " + c + " D is: " + d );
                                                            }
                                                        }
                                                        
                                                }
                                        }
                                }
                        }
                }
        }
}
    

Picture of the output

Assignment 119