Assignment 118

Code

//Matthew Hughs
//arm.java
//5th period
//5/9/2016

class arm
{
    public static void main (String [] args)
    {
        int counter = 100;
        for(int hun = 1; hun < 10; hun++)
        {
            for (int ten = 0; ten < 10; ten++)
            {
                for (int one = 0; one < 10; one++)
                {
                    double pos = Math.pow(hun,3) + Math.pow(ten,3) + Math.pow(one,3);
                    if (pos == counter)
                    {
                        System.out.print(counter + " ");
                    }
                    counter++;
                }
            }
        }
    }
}
    

Picture of the output

Countingfor