#include #include using namespace std; int main() { cout << "Please type a year: "; int year {0}; cin >> year; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } if (year % 400 == 0) { //year is a multiple of 400, e.g. 1600 or 2000 cout << year << " is a leap year.\n"; } else if (year % 100 == 0) { //year is a multiple of 100, e.g. 1800 or 1900 cout << year << " is not a leap year.\n"; } else if (year % 4 == 0) { //year is a multiple of 4, e.g. 2020 or 2024 cout << year << " is a leap year.\n"; } else { //none of the above cout << year << " is not a leap year.\n"; } return EXIT_SUCCESS; }