1 条题解
-
0
C :
#include<stdio.h> int main() { int year, month; // 平年各个月的天数 int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; // 闰年各个月的天数 int b[]={0,31,29,31,30,31,30,31,31,30,31,30,31}; scanf("%d,%d", &year, &month); if (month < 1 || month > 12) { printf("Input error!\n"); }else{ // 闰年 if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { printf("%d days\n", b[month]); } else{ printf("%d days\n", a[month]); } } }
- 1
信息
- ID
- 102
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者