mor
import java.util.Scanner;
public class mor
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int choice = 1;
while ( choice != 3 ) {
System.out.println();
System.out.println( "selection:" );
System.out.println( "1: Find 2 digit numbers <= 56 with sums of digits > 10" );
System.out.println( "2: Find 2 digit number minus number reversed which equals sum of digits" );
System.out.println( "3: exit" );
System.out.println();
System.out.print( ">" );
choice = keyboard.nextInt();
System.out.println();
if ( choice == 1 ) {
function1();
} else if ( choice == 2 ) {
function2();
}
}
}
public static void function1() {
for ( int i=1; i< 6; i++ ) {
for ( int n=0; n< 10; n++ ) {
int c = n + i;
if ( c > 10 ) {
int d = i * 10 + n;
if ( i < 5 || n < 7 ) {
System.out.println( d );
}
}
}
}
}
public static void function2() {
for ( int i=1; i< 10; i++ ) {
for ( int n=0; n< 10; n++ ) {
int c = i + n;
int big = i * 10 + n;
int little = n * 10 + i;
int sub = big - little;
if ( c == sub ) {
System.out.println( big );
}
}
}
}
}
Picture of the output