#include <stdio.h>
void panDuanRunNian (int num){
if((num %4 == 0 && num % 100 != 0) || num %400 == 0){
printf("%d是闰年\n",num);
}else{
printf("%d不是闰年\n",num);
}
}
int main(int argc, const char * argv[]) {
printf("请输入一个年份\n");
int year = 0 ;
scanf("%d",&year);
panDuanRunNian(year);
return 0;
}
|
|