Assignemnt #118 Number Puzzles

Code

    ///Name: Joshua Pell
    ///Period: 6
    ///Project Name: Number Puzzles
    ///File Name: numPuzzles.java
    ///Date: 5/31/2015
    
public class numPuzzles
{
        public static void main( String[] args )
        {
                for (int a = 1; a < 10; a++ )
                {
                        for (int b = 1; b < 10; b++ )
                        {
                                for ( int c = 1; c < 10; c++ )
                                {
                                        int d = a * a * a, e = b * b * b, f = c * c * c, g = a * 100 + b * 10 + c;
                                        if ( (d + e + f) == g )
                                            System.out.println( g );
                                }
                        }
                }
        }
}
    

Picture of the output

Assignment 118