4 条题解
-
1
#include <bits/stdc++.h> using namespace std;
int main() { int y, m, d, s = 0; int a[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; cin >> y >> m >> d; if (y % 400 == 0 || y % 4 == 0 && y % 100) { a[2]++; } for (int i = 1; i < m; i++) { s = s + a[i]; } s = s + d; cout << s; return 0; }
-
0
#include <bits/stdc++.h> using namespace std;
int days[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() { int y, m, d, h = 0; cin >> y >> m >> d; if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) { days[2]++; } for (int i = 1; i < m; i++) { h = h + days[i]; } h = h + d; cout << h; return 0; }
-
-1
#include <bits/stdc++.h> using namespace std;
int a[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() { int y, m, d, s = 0; cin >> y >> m >> d; if (y % 400 == 0 || y % 4 == 0 && y % 100) { a[2]++; } for (int i = 1; i < m; i++) { s = s + a[i]; } s += d; cout << s; return 0; }
-
-1
#include <bits/stdc++.h> using namespace std;
int a[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() { int y, m, d, s = 0; cin >> y >> m >> d; if (y % 400 == 0 || y % 4 == 0 && y % 100) { a[2]++; } for (int i = 1; i < m; i++) { s = s + a[i]; } s = s + d; cout << s; return 0; }
- 1
信息
- ID
- 339
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 6
- 标签
- 递交数
- 139
- 已通过
- 42
- 上传者