Day of the week: Difference between revisions
Content added Content deleted
(→{{header|C++}}: Removed boost usage) |
|||
Line 1,644: | Line 1,644: | ||
=={{header|C++}}== |
=={{header|C++}}== |
||
<syntaxhighlight lang="cpp">#include < |
<syntaxhighlight lang="cpp">#include <chrono> |
||
#include <ranges> |
|||
#include <iostream> |
#include <iostream> |
||
int main( |
int main() { |
||
⚫ | |||
using namespace boost::gregorian ; |
|||
for (int year : std::views::iota(2008, 2121) |
|||
| std::views::filter([](auto year) { |
|||
std::cout |
|||
if (std::chrono::weekday{ |
|||
⚫ | |||
std::chrono::year{year}/std::chrono::December/25} |
|||
for ( int i = 2008 ; i < 2121 ; i++ ) { |
|||
== std::chrono::Sunday) { |
|||
greg_year gy = i ; |
|||
return true; |
|||
} |
|||
return false; |
|||
⚫ | |||
} |
})) { |
||
⚫ | |||
} |
} |
||
std::cout << "\n" ; |
|||
return 0 ; |
|||
}</syntaxhighlight> |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |