Assignemnt #119

Code

          /// Name: Holden Ganch
          /// Period: 7
          /// Program Name:  sixtieth Program
          /// File Name: EnterPIN.java
          /// Date Finished: 10/5/2015


    
                       import java.util.Scanner;
public class Armstrong
{
	public static void main( String[] args ) throws Exception
	{
        Scanner kb = new Scanner (System.in);
        
        for (int a = 1; a < 10; a++)
        {
        for (int b = 0; b < 10; b++)
        {
        for (int c = 0; c < 10; c++)
        {
            int x = (100*a) + ( 10 * b ) + c;
            int z = ( a * a * a) + ( b*b*b) + (c*c*c);
            
            if (x == z)
            {
                System.out.println(a+""+b+""+c);
            }
        }
        }
        }
    }
}



    

Picture of the output

Assignment 119