Added 1st_day_of_month.cpp
This commit is contained in:
parent
b6cea998ba
commit
868e347c4c
15
1st_day_of_month.cpp
Normal file
15
1st_day_of_month.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
// @COMPILECMD g++ $@ -lboost_date_time
|
||||
#include <iostream>
|
||||
#include <boost/date_time/gregorian/gregorian.hpp>
|
||||
|
||||
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user