1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【实践课内】3.选择结构2/7-3 21选择-盘闰年.c

22 lines
407 B
C
Raw Normal View History

2024-10-23 02:25:07 +00:00
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
// 判断闰年
if ((n % 4 == 0 && n % 100 != 0) || n % 400 == 0) {
// 判断是否含 4
if (n % 10 == 4 || n / 10 % 10 == 4 || n / 100 % 10 == 4 || n / 1000 % 10 == 4) {
printf("panta!\n");
} else {
printf("1\n");
}
} else {
printf("0\n");
}
return 0;
}