Assignemnt 119 and A New Hope
Code
/// Name: Xinting Chen
/// Period: 7
/// Program Name: A New Hope
/// File Name: NewHope.java
/// Date Finished: 5/9/2016
import java.util.Scanner;
public class NewHope
{
public static void main( String[] args ) throws Exception
{
System.out.println();
for ( int i = 1; i < 43; i++)
{
for ( int a = 1; a < 43; a++)
{
for ( int b = 1; b < 43; b++)
{
for ( int c = 1; c < 43; c++)
{
if ( (i+a+b+c)==45 && i+2==a-2 && b*2==c/2 && a-2==b*2 )
System.out.print(" "+i+" "+a+" "+b+" "+c+"\n");
}
}
}
}
}
}
Picture of the output