Assignemnt #118 armstrong.java

Code

    /// Name: Boris Kazantsev
    /// Period: 6
    /// Program Name: armstrong
    /// File Name: armstrong.java
    /// Date Finished: 5/20/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

Pic