2 条题解
-
1
#include <bits/stdc++.h> using namespace std; int main() { int a, n; cin >> a >> n; if (a % 400 == 0) { if (n == 2) { cout << "29"; } else if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12) { cout << "31"; } else { cout << "30"; } } else if (a % 4 == 0 && a % 100 != 0) { if (n == 2) { cout << "29"; } } else if (n == 2) { cout << "28"; } if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12) { cout << "31"; } else if (n == 4 || n == 6 || n == 9 || n == 11) { cout << "30"; } return 0; }
- 1
信息
- ID
- 821
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 2
- 标签
- 递交数
- 71
- 已通过
- 45
- 上传者