fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int year;
  6. cout << "Enter a full year: ";
  7. cin >> year;
  8.  
  9. if ((year % 4 == 0 && year & 100 != 0) || (year % 400 == 0)) {
  10. cout << "The year " << year << " is a leap year.\n";
  11. } else {
  12. cout << " the year " << year << " is NOT a leap year.\n";
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
Enter a full year:  the year 32764 is NOT a leap year.