r/dailyprogrammer • u/mattryan • Mar 17 '12
[3/17/2012] Challenge #27 [intermediate]
Happy St. Patrick's Day! Write a program that accepts a year as input and outputs what day St. Patrick's Day falls on.
Bonus: Print out the number of times St. Patrick's Day falls on a Saturday for this century.
Sample Run:
Enter Year: 2012
St. Patrick's Day is on a Saturday.
Enter Year: 2010
St. Patrick's Day is on a Wednesday.
7
Upvotes
2
u/jelengar Mar 17 '12
1
u/[deleted] Mar 17 '12
Javascript:
The days of the week return value is only an integer, sadly.
1
u/defrost Mar 18 '12
C Code, two lines, all complete, no libraries.
On Codepad.
1
u/luxgladius 0 0 Mar 18 '12
Perl, no libraries
Output
1
u/JerMenKoO 0 0 Mar 18 '12
Python 3.x:
1
u/Yuushi Mar 20 '12
Haskell:
1
u/lukz 2 0 Mar 20 '12
Common Lisp