Assignment #118 NumberPuzzlesIII

Code

    
    /// Name: Lacey Reese 
    /// Period: 5
    /// Program Name:  NumberPuzzlesIII
    /// File Name:  NumberPuzzlesIII.java
    /// Date Finished 5/5/2016
                     
   public class NumberPuzzlesIII 
 {    
    
        public static void main( String[] args ) 
        {
            
            for ( int i=1; i< 10; i++ ) {
                for ( int n=0; n< 10; n++ ) {
                    for ( int c=0; c< 10; c++ ) {
                        int a = i * 100 + n * 10 + c;
                        int b = i * i * i + n * n * n + c * c * c;
                        
                        if ( a == b ) {
                            System.out.println( a );
                        }
                    }
                }
            }
            
        }
    }


    

Picture of the output

Assignment 118