Assignemnt #122
Code
/// Name: Connor Siri
/// Period: 7
/// Program Name: Armstrong
/// File Name: Armstrong.java
/// Date Finished: 3/3/2016
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