#include #include #include //for class string using namespace std; int main() { const string a[] { "", //dummy element has subscript 0 "A 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" //and this one will be 5 "Seven swans a-swimming", "Eight maids a-milking", "Nine ladies dancing", "Ten lords a-leaping", "Eleven pipers piping", "Twelve 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 << " 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; }