1 solutions
-
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
Information
- ID
- 85
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By