12 days of christmas
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
Print 12 days of christmas (what's the input?)
Options
exec is denied
no deadline, the server will not save your submission
Sample input:_
for(var d=1,g="",i;d<=12;d++){g+=("On the "+["first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth"][d-1]+" day of Christmas my true love gave to me: ");for(i=d;i>0;i--)g+=["twelve Drummers Drumming, ","eleven Pipers Piping, ","ten Lords-a-Leaping, ","nine Ladies Dancing, ","eight Maids-a-Milking, ","seven Swans-a-Swimming, ","six Geese-a-Laying, ","five Gold Rings, ","four Calling Birds, ","three French Hens, ","two Turtle Doves, ","a Partridge in a Pear Tree."][12-i]+(i==1?"":i==2?" and ":"");print(g);g=""}
Sample output:
On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.
On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.
On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.
Ranking
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | rotary-o | 78 | 0.0178 | 2026/07/30 00:00:50 | 0B / 40B / 37B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | rotary-o | 78 | 0.0596 | 2026/07/30 00:00:37 | 0B / 40B / 37B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | tails | 89 | 0.0166 | 2026/07/27 02:52:04 | 0B / 19B / 69B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | hallvabo | 107 | 0.0328 | 2026/07/31 07:55:27 | 0B / 54B / 45B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | hallvabo | 105 | 0.0474 | 2026/07/31 07:57:28 | 0B / 51B / 46B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | JOrE20 | 16 | 0.0217 | 2026/07/27 01:29:56 | 0B / ?B / ?B |
| 2 | #c0ffee | 16 | 0.0200 | 2026/07/27 07:38:01 | 0B / 12B / 4B |
| 3 | #c0ffee() | 460 | 0.0213 | 2026/07/27 07:56:34 | 0B / 332B / 100B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | rotary-o | 180 | 0.0661 | 2026/08/09 17:18:08 | 0B / 106B / 69B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | rotary-o | 169 | 0.0384 | 2026/08/09 17:18:22 | 0B / 103B / 59B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | McBusLuck | 142 | 0.0156 | 2026/07/27 18:46:14 | 0B / 39B / 78B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | JOrE20 | 4 | 0.0116 | 2026/07/27 01:31:14 | 0B / ?B / ?B |
| 2 | #c0ffee | 4 | 0.0127 | 2026/07/27 07:53:45 | 0B / 4B / 0B |
| 3 | McBusLuck | 4 | 0.0214 | 2026/07/27 17:54:19 | 0B / 4B / 0B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | McBusLuck | 4 | 0.0242 | 2026/07/27 17:54:27 | 0B / 4B / 0B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | McBusLuck | 4 | 0.0478 | 2026/07/27 17:54:32 | 0B / 4B / 0B |
| Rank | User | Size | Time | Date | Statistics |
|---|
| 1 | rotary-o | 122 | 2.9033 | 2026/08/09 17:04:55 | 0B / 64B / 55B |
Language Ranking_
| Rank | Lang | User | Size | Score |
| 1 | Bash | JOrE20 | 4 | 10000 |
| 2 | Zsh | McBusLuck | 4 | 10000 |
| 3 | Fish | McBusLuck | 4 | 10000 |
| 4 | JavaScript | JOrE20 | 16 | 2500 |
| 5 | Ruby2 | rotary-o | 78 | 512 |
| 6 | Ruby | rotary-o | 78 | 512 |
| 7 | Perl | tails | 89 | 449 |
| 8 | Python3 | hallvabo | 105 | 380 |
| 9 | Python | hallvabo | 107 | 373 |
| 10 | Scala | rotary-o | 122 | 327 |
| 11 | sed | McBusLuck | 142 | 281 |
| 12 | C# | rotary-o | 169 | 236 |
| 13 | Java | rotary-o | 180 | 222 |
return to the top page