Assignemnt #119 hope.java

Code

    /// Name: Boris Kazantsev
    /// Period: 6
    /// Program Name: hope
    /// File Name: hope.java
    /// Date Finished: 5/20/2016
    
  public class hope{
    public static void main(String[] args){
        for (int a = 1; a < 45; a++)
        {
            for ( int b = 1; b < 45; b++)
            {
                for ( int c = 1; c < 45; c++)
                {
                    for ( int d = 1; d < 45; d++)
                    {
                        if ( (a+b+c+d) ==45 && (a+2)==(b-2) && (c*2)==(d/2) && (b-2) == (c*2))
                            System.out.print(" "+ a+" "+b+" "+c+" "+d);
                    }
                }
            }
        }
        
        System.out.println();
    }
}


   
    

Picture of the output

Pic