1if (i%4==0 && i%100!=0 || i%400==0) {
2months[2] = 29;
3}
4else {
5month[2] = 28;
6}
1#include <iostream>
2using namespace std;
3
4int main() {
5 int year;
6 cout << "Enter a year: ";
7 cin >> year;
8 if (year % 4 == 0) {
9 if (year % 100 == 0) {
10 (year % 400 == 0) ?
11 cout << year << " is a leap year." :
12 cout << year << " is not a leap year.";
13 }
14 else
15 cout << year << " is a leap year.";
16 }
17 else
18 cout << year << " is not a leap year.";
19 return 0;
20}