#include<stdio.h> #include<stdlib.h> int main() { int year=0; int count=0; //计算有多少个闰年 for(year=1000;year<=2000;year++) { if((year%4==0&&year%100!=0)||(year%400==0)) { printf("%5d",year); count++; } } printf("\n"); printf("%d\n",count); system("pause"); return 0; }
时间: 2024-11-11 05:55:59