
public class ChristmasSong {

    public static void main(String[] args) {
        String ordinal = "";
        for (int cardinal = 1; cardinal <= 12; ++cardinal) {
            switch (cardinal) {
                case 1:
                    ordinal = "first";
                    break;
                case 2:
                    ordinal = "second";
                    break;
                case 3:
                    ordinal = "third";
                    break;
                case 4:
                    ordinal = "fourth";
                    break;
                case 5:
                    ordinal = "fifth";
                    break;
                case 6:
                    ordinal = "sixth";
                    break;
                case 7:
                    ordinal = "seventh";
                    break;
                case 8:
                    ordinal = "eighth";
                    break;
                case 9:
                    ordinal = "ninth";
                    break;
                case 10:
                    ordinal = "tenth";
                    break;
                case 11:
                    ordinal = "eleventh";
                    break;
                case 12:
                    ordinal = "twelfth";
                    break;
            }
            System.out.println("\nOn the " + ordinal
                    + " day of Christmas my true love gave to me...");
            switch (cardinal) {
                case 12:
                    System.out.println("\ttwelve drummers drumming,");
                case 11:
                    System.out.println("\televen lords a-leaping,");
                case 10:
                    System.out.println("\tten pipers piping,");
                case 9:
                    System.out.println("\tnine ladies dancing,");
                case 8:
                    System.out.println("\teight maids a-milking,");
                case 7:
                    System.out.println("\tseven swans a-swimming,");
                case 6:
                    System.out.println("\tsix geese a-laying,");
                case 5:
                    System.out.println("\tfive golden rings,");
                case 4:
                    System.out.println("\tfour calling birds,");
                case 3:
                    System.out.println("\tthree French hens,");
                case 2:
                    System.out.println("\ttwo turtle doves,");
                case 1:
                    System.out.print(cardinal > 1 ? "\tand " : "\t");
                    System.out.println("a partridge in a pear tree.");
            }
        }
    }
}
