/****************************************************************************** * This program computes leap years. * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ #include #include #include #include std::locale utf8loc(std::locale(), new std::codecvt_utf8); using namespace std; static int const YEAR = 1900; int main(int argc, char **argv) { setlocale(LC_ALL, "en_US.UTF-8"); wcout.imbue(utf8loc); wcin.imbue(utf8loc); bool const isLeapYear = YEAR % 4 == 0 && YEAR % 100 != 0 || YEAR % 400 == 0; wcout << YEAR << L" is " << (isLeapYear ? L"" : L"NOT ") << L"a leap year." << endl; return 0; }