Assignemnt #118: Number Puzzle III: Armstrong Numbers
Code
/// Name: Cassie Rapp
/// Period: 6
/// Program Name: Number Puzzles III: Armstrong Numbers
/// File Name: PuzzIII.java
/// Date Finished: 5/3/2016
public class PuzzIII {
public static void main( String[] args ) {
for ( int i=1; i< 10; i++ ) {
for ( int n=0; n< 10; n++ ) {
for ( int c=0; c< 10; c++ ) {
int a = i * 100 + n * 10 + c;
int b = i * i * i + n * n * n + c * c * c;
if ( a == b ) {
System.out.println( a );
}
}
}
}
}
}
Picture of the output