Skip to content

Instantly share code, notes, and snippets.

/main.cpp
Created Dec 20, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.