Created
December 20, 2016 03:29
-
-
Save anonymous/55a9b274f10d93dfbbce8c0517a653bd to your computer and use it in GitHub Desktop.
Twelve Days Of Christmas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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