Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- #include <cstdlib>
- using namespace std;
- string gifts[] = {"a Partridge in a pear tree.", "two Turtle Doves, ", "three French Hens, ", "four Calling birds"};
- string day[] = {"first","second","third","fourth"};
- int main()
- {
- for (int i = 0; i < 4; i++) {
- cout << "On the " << day[i] << " day of Christmas my true love gave to me: " << endl;
- for (int j = i; j >= 0; j--) {
- if (j > 0) {
- cout << gifts[j] << endl;
- } else {
- cout << "and " << gifts[j] << endl;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment