1 条题解
-
0
C :
#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { int year; int k = scanf("%d", &year); // 读入的年只能是正整数, %d可确保读入的是整数,但无法保证是正整数 // 所以需要判断 if (k != 1 || year < 0) { printf("Input error!\n"); } else if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
- 1
信息
- ID
- 85
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者