public class NumPuzzle { public static void main( String[] args ) throws Exception { int num, num1; for( num = 0; num < 61; num++ ) { for ( num1 = 0; num1 < 61; num1++ ) { if ( num+num1 == 60 && num-num1 == 14 ) { System.out.println( num + " and " + num1 ); } } } } }