in reply to Re: How do you remember the number of days in each month?
in thread How do you remember the number of days in each month?
DB<105> print 30+($_+($_>7))%2 for 1..12 31 30 31 30 31 30 31 31 30 31 30 31 DB<106> print 30+($_+($_>7))%2-2*($_==2) for 1..12 31 28 31 30 31 30 31 31 30 31 30 31 DB<113> print ((30,31,28)[($_+($_>7))%2-($_==2)]) for 1..12 31 28 31 30 31 30 31 31 30 31 30 31 30 31
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
|
|---|