Commits

Thibaut Cuvelier committed 628aafe

19. Mathematica

  • Participants
  • Parent commits 53d1865

Comments (0)

Files changed (1)

+(* Content-type: application/vnd.wolfram.mathematica *)
+
+(*** Wolfram Notebook File ***)
+(* http://www.wolfram.com/nb *)
+
+(* CreatedBy='Mathematica 8.0' *)
+
+(*CacheID: 234*)
+(* Internal cache information:
+NotebookFileLineBreakTest
+NotebookFileLineBreakTest
+NotebookDataPosition[       157,          7]
+NotebookDataLength[      2524,         88]
+NotebookOptionsPosition[      2105,         68]
+NotebookOutlinePosition[      2448,         83]
+CellTagsIndexPosition[      2405,         80]
+WindowFrame->Normal*)
+
+(* Beginning of Notebook Content *)
+Notebook[{
+
+Cell[CellGroupData[{
+Cell[BoxData[{
+ RowBox[{"<<", "Calendar`"}], "\[IndentingNewLine]", 
+ RowBox[{
+  RowBox[{
+   RowBox[{"sum", " ", "=", " ", "0"}], ";"}], " "}], "\[IndentingNewLine]", 
+ RowBox[{"For", "[", 
+  RowBox[{
+   RowBox[{"y", "=", "1901"}], ",", 
+   RowBox[{"y", "\[LessEqual]", "2000"}], ",", 
+   RowBox[{"y", "++"}], ",", "\[IndentingNewLine]", 
+   RowBox[{"For", "[", 
+    RowBox[{
+     RowBox[{"m", "=", "1"}], ",", " ", 
+     RowBox[{"m", "\[LessEqual]", " ", "12"}], ",", " ", 
+     RowBox[{"m", "++"}], ",", " ", "\[IndentingNewLine]", 
+     RowBox[{"If", "[", 
+      RowBox[{
+       RowBox[{
+        RowBox[{"DayOfWeek", "[", 
+         RowBox[{"{", 
+          RowBox[{"y", ",", " ", "m", ",", " ", "1"}], "}"}], "]"}], 
+        "\[Equal]", "Sunday"}], ",", 
+       RowBox[{"sum", "+=", "1"}]}], "]"}]}], "]"}]}], 
+  "]"}], "\[IndentingNewLine]", 
+ RowBox[{"Print", "[", "sum", "]"}]}], "Input",
+ CellChangeTimes->{{3.531414249265254*^9, 3.5314144583509655`*^9}, {
+   3.5314145215219355`*^9, 3.5314145224169493`*^9}, 3.531414554153105*^9}],
+
+Cell[BoxData["171"], "Print",
+ CellChangeTimes->{
+  3.5314144105002303`*^9, 3.5314144591759777`*^9, {3.531414527109522*^9, 
+   3.5314145547381144`*^9}}]
+}, Open  ]],
+
+Cell[CellGroupData[{
+
+Cell[BoxData[
+ RowBox[{"DayOfWeek", "[", 
+  RowBox[{"{", 
+   RowBox[{"2000", ",", " ", "12", ",", " ", "1"}], "}"}], "]"}]], "Input",
+ CellChangeTimes->{{3.5314144701036463`*^9, 3.531414476096238*^9}}],
+
+Cell[BoxData["Friday"], "Output",
+ CellChangeTimes->{3.5314144766762466`*^9}]
+}, Open  ]]
+},
+WindowSize->{707, 817},
+WindowMargins->{{1, Automatic}, {Automatic, 1}},
+FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (February 23, 2011)",
+StyleDefinitions->"Default.nb"
+]
+(* End of Notebook Content *)
+
+(* Internal cache information *)
+(*CellTagsOutline
+CellTagsIndex->{}
+*)
+(*CellTagsIndex
+CellTagsIndex->{}
+*)
+(*NotebookFileOutline
+Notebook[{
+Cell[CellGroupData[{
+Cell[579, 22, 1037, 26, 132, "Input"],
+Cell[1619, 50, 152, 3, 23, "Print"]
+}, Open  ]],
+Cell[CellGroupData[{
+Cell[1808, 58, 201, 4, 31, "Input"],
+Cell[2012, 64, 77, 1, 30, "Output"]
+}, Open  ]]
+}
+]
+*)
+
+(* End of internal cache information *)