Assignemnt #118 Arm Strong
Code
/// Name: Caelan Dorstad
/// Period: 6
/// Program Name: armstrong
/// File Name: armstrong.java
/// Date Finished: 5/5/2016
public class armstrong{
public static void main(String[] args){
System.out.println();
for (int a = 0; a < 10; a++)
{
for ( int b = 0; b < 10; b++)
{
for (int c = 0; c < 10; c++)
{
if ( (a*100 + b*10 + c) == Math.pow(a,3)+Math.pow(b,3)+Math.pow(c,3) )
{
System.out.print(a);
System.out.print(b);
System.out.print(c);
System.out.println();
}
}
}
}
System.out.println();
}
}
Picture of the output