Assignment #118 Armstrong Numbers
Code
/// Name: DeeJay Cerezo
/// Period: 7
/// Program Name: Armstrong
/// File Name: Arm.java
/// Date Finished: 4/25/2016
public class Arm
{
public static void main( String[] args ) throws Exception
{
System.out.println();
for ( int i = 1; i < 10; i++)
{
for ( int j = 0; j < 10; j++)
{
for ( int k = 0; k < 10; k++)
{
if ( (i*100+j*10+k)== Math.pow(i,3)+ Math.pow(j,3) + Math.pow(k,3))
{
System.out.print(i);
System.out.print(j);
System.out.print(k+" ");
}
}
}
}
System.out.println();
}
}
Picture of the output