#include #include #include //for class string using namespace std; int main() { const string a[] { "", //dummy element has subscript 0 "Partridge in a Pear Tree", //so that this element will be 1 "Two Turtledoves", //and this one will be 2 "Three French hens", //etc. "Four Colly Birds", "Five Golden rings", "Six Geese a-Laying", "Seven Swans a-Swimming", "Eight Maids a-Milking", "Nine Ladies Dancing", "Ten Lords a-Leeping", "Eleven Pipers Piping", "Tweleve Drummers Drumming", }; const size_t ndays {size(a)-1}; //Don't count the dummy. 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) { cout << "\t" << a[gift] << "\n"; //indent with a tab cout << "\n"; //Skip a line after each day. } } return EXIT_SUCCESS; }