Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2016 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/55a9b274f10d93dfbbce8c0517a653bd to your computer and use it in GitHub Desktop.
Save anonymous/55a9b274f10d93dfbbce8c0517a653bd to your computer and use it in GitHub Desktop.
Twelve Days Of Christmas
#include <iostream>
#include <string>
using namespace std;
int main() {
char c;
string days[] = { "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eigth", "ninth", "tenth", "eleventh", "twelvth" };
string things[] = {
"1 Partridge in a Pear Tree",
"2 Turtle Doves",
"3 French Hens",
"4 Calling Birds",
"5 Golden Rings",
"6 Geese a Laying",
"7 Swans a Swimming",
"8 Maids a Milking",
"9 Ladies Dancing",
"10 Lords a Leaping",
"11 Pipers Piping",
"12 Drummers Drumming"
};
for (int i = 0; i < 12; i++) {
cout << "\n" << endl;
cout << "On the " + days[i] + " day of Christmas" << endl;
cout << "My True Love sent to me:" << endl;
for (int j = i; j != -1; j--) {
if (i > 0 && j == 0) {
cout << "And " + things[j] << endl;
}
else cout << things[j] << endl;
}
}
cin >> c;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment