#include #include #include #include using namespace std; int main() { string a[] { "", "partridge in a pear tree.", "turtledoves", "French hens", "colly birds", "golden Rings", "geese a-laying", "swans a-swimming", "maids a-milking", "ladies dancing", "lords a-leaping", "pipers piping", "drummers drumming" }; int ndays {size(a) - 1}; for (int day {1}; day <= ndays; ++day) { cout << "On the " << day; if (day == 1) { cout << "st"; } else if (day == 2) { cout << "nd"; } else if (day == 3) { cout << "rd"; } else { cout << "th"; } cout << " day of Christmas\n" << "My true love gave to me\n"; for (int gift {day}; gift >= 1; --gift) { if (gift > 1) { cout << setw(2) << gift; } else if (day == 1) { cout << "A"; } else { cout << "And a"; } cout << " " << a[gift] << "\n"; } cout << "\n"; } return EXIT_SUCCESS; }