import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class App {
    public static void main(String[] args) {

    }
    public static int sum() {
        int sum = 0;
        int isInputting = 1;
        System.out.println("Enter numbers to get sum. Enter blank to stop and get result");
        while (isInputting == 1) {
            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            try {
                int number = 1;
                int numberIndex = 1;
                String[] numberString = {"st","nd","rd","th","th","th","th","th","th","th",};
                if (number >= 10) {
                    number = number - 10;
                    if (numberIndex == 1) {
                        numberIndex = 10;
                    }
                    else {
                        numberIndex = numberIndex + 10;
                    }
                    System.out.println("Enter the " + number + numberString[number-1] + "number:");
                }
                
            } catch (Exception e) {
                return sum;
            }
        }

        return sum;
    }
}


    
