Assignment #118

Code

/// Name: Jonathan Stine
/// Period: 5
/// Program Name: Number Puzzles III: Armstrong Numbers
/// File Name: Armstrong.java
/// Date Finished: 3/28/2016
    
    public class Armstrong {    
    
        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 );
                        }
                    }
                }
            }
            
        }
    }
    
 
    

Code Output