From 868e347c4cea4bee4e981dee3edc5049e54df27a Mon Sep 17 00:00:00 2001 From: anon Date: Sun, 10 Mar 2024 15:57:35 +0100 Subject: [PATCH] Added 1st_day_of_month.cpp --- 1st_day_of_month.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 1st_day_of_month.cpp diff --git a/1st_day_of_month.cpp b/1st_day_of_month.cpp new file mode 100644 index 0000000..336a486 --- /dev/null +++ b/1st_day_of_month.cpp @@ -0,0 +1,15 @@ +// @COMPILECMD g++ $@ -lboost_date_time +#include +#include + +int main() { + int year = 2023; + int month = 7; + + boost::gregorian::date firstDay(year, month, 1); + boost::gregorian::date::day_of_week_type weekday = firstDay.day_of_week(); + + std::cout << "The first day of " << month << "/" << year << " is a " << weekday << std::endl; + + return 0; +}