int a, b; printf("输入年份,你会知道是否是闰年\n"); scanf("%d", &a); { if( (a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) b = 1; else b = 0; } if (b == 1) { printf("是闰年\n", a); } else { printf("非闰年\n,a"); }