输出1900-2000年中是闰年的年份,能被4整除但不能被100整除;能被100整除且能被400整除
#include<iostream> using namespace std; int main(){ int i; for(int i=1900;i<=2000;i++){ if(i%4==0&&i%100!=0||i%100==0&&i%400==0){ cout<<i; } } return 0; }