#include #include using namespace std; int main() { struct thing { string preposition; //"in" or "on" string noun; }; thing a[] { {"in", "ground"}, {"on", "tree"}, {"on", "limb"}, {"on", "branch"}, {"in", "nest"}, {"in", "egg"}, {"on", "bird"} }; int n {size(a)}; //how many things for (int i {1}; i < n; ++i) { //Start with the tree (number 1). if (i == 1) { cout << "Oh in the woods"; } else { cout << "And " << a[i-1].preposition << " that " << a[i-1].noun; } cout << " there was a " << a[i].noun << "\n" << "The prettiest " << a[i].noun << "\n" << "You ever did see.\n"; for (int j {i}; j >= 1; --j) { //End with the tree (number 1). cout << "And the " << a[j].noun << " " << a[j-1].preposition << " the " << a[j-1].noun << "\n"; } for (int k {0}; k < 2; ++k) { cout << "And the green grass grew all around, all around.\n"; } cout << "\n"; } return EXIT_SUCCESS; }