代码如下:
1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int a; 6 cin>>a; 7 if((a%4==0 &&a%100!=0)||a%400==0) 8 cout<<a<<" is a leap year"; 9 else cout<<a<<" is not a leap year"; 10 return 0; 11 }
2023-08-29 17:11:58
代码如下:
1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int a; 6 cin>>a; 7 if((a%4==0 &&a%100!=0)||a%400==0) 8 cout<<a<<" is a leap year"; 9 else cout<<a<<" is not a leap year"; 10 return 0; 11 }