langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
8
Task/Five-weekends/Mathematica/five-weekends.math
Normal file
8
Task/Five-weekends/Mathematica/five-weekends.math
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
years = {1900, 2100}; months = {1 ,3 ,5 ,7 ,8 ,10 ,12};
|
||||
result = Select[Tuples[{Range@@years, months}], (DateString[# ~ Join ~ 1, "DayNameShort"] == "Fri")&];
|
||||
|
||||
Print[result // Length," months with 5 weekends" ];
|
||||
Print["First months: ", DateString[#,{"MonthName"," ","Year"}]& /@ result[[1 ;; 5]]];
|
||||
Print["Last months: " , DateString[#,{"MonthName"," ","Year"}]& /@ result[[-5 ;; All]]];
|
||||
Print[# // Length, " years without 5 weekend months:\n", #] &@
|
||||
Complement[Range @@ years, Part[Transpose@result, 1]];
|
||||
Loading…
Add table
Add a link
Reference in a new issue