christmas.c
teklabs!ogcvax!metheus!cdi!caf
teklabs!ogcvax!metheus!cdi!caf
Tue Dec 21 02:45:23 AEST 1982
/*
* Translated from a Pascal program by Pete Mackie
* C program by Chuck Forsberg 12-20-82
*/
#include <stdio.h>
char *days[] = {
"first", "second", "third", "fourth", "fifth", "sixth",
"seventh", "eight", "ninth", "tenth", "eleventh", "twelfth"
};
char *gifts[] = {
"Tvelve drummers drumming",
"Eleven pipers piping",
"Ten lords a-leaping",
"Nine ladies dancing",
"Eight maids a-milking",
"Seven seans a-swimming",
"Six geese a-laying",
"Five golden rings",
"Four calling Birds",
"Three French hens",
"Two turtle doves",
0
};
main()
{
register int day; register char **pp, **qq;
for (day = 0, pp = &gifts[11]; day<12; ++day) {
printf("On the %s day of Christmas my true love gave to me -\n",
days[day]);
if(day) {
for(qq = --pp; *qq; ++qq)
printf("%s,\n", *qq);
printf("And a partridge in a pear tree.\n\n");
}
else
printf("A partridge in a pear tree.\n\n");
}
}
More information about the Comp.sources.unix
mailing list