Assignment # 118 and Puzzles 3

Code

    /// Name: Tommy Oyuntseren
    /// Period: 7
    /// Program Name: Puzzles3
    /// File Name: Puzzles3.java
    /// Date: 5/27/16

    public class Puzzles3
    {
    	public static void main(String[] args)
    	{
            for (int a=1; a<10; a++)
                for (int b=0; b<10; b++)
                    for (int c=0; c<10; c++)
                    {
                        int d = (100*a) + (10*b) + c;
                        int e = (a*a*a) + (b*b*b) + (c*c*c);
                        if (d == e)
                            System.out.println(d + "\n");
                    }
        }
    }
	

  

Picture of the output

Assignment 118