Assignemnt 118 and Armstrong Numbers
Code
/// Name: Xinting Chen
/// Period: 7
/// Program Name: Armstrong Numbers
/// File Name: ArmstrongNumbers.java
/// Date Finished: 5/4/2016
import java.util.Scanner;
public class ArmstrongNumbers
{
public static void main( String[] args ) throws Exception
{
System.out.println();
for( int i =1; i<10; i++)
{
for( int a=0; a<10; a++)
{
for( int b=0; b<10; b++)
{
if ((i*100+a*10+b)== Math.pow(i,3)+ Math.pow(a,3)+ Math.pow(b,3))
{
System.out.println(i);
System.out.println(a);
System.out.println(b+ " ");
}
}
}
}
}
}
Picture of the output