一级
#include<bits/stdc++.h>
using namespace std;
bool is_run(int y) {
return ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0));
}
int main() {
int y1, y2;
cin >> y1 >> y2;
int sum = 0;
for (int i = y1 + 1; i <= y2 - 1; ++ i) {
if (is_run(i)) sum += i;
}
cout << sum << endl;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main() {
int h, m, s;
char c;
cin >> h >> m >> s >> c;
int ans = h * 3600 + m * 60 + s;
if (c == 'P') ans += 12 * 3600;
cout << ans << endl;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main() {
int s;
cin >> s;
int ans = 0;
for (int l = 2; l <= s; ++ l) {
for (int w = 1; w <= l && w * l <= s; ++ w) {
if (w * l == s) ++ ans;
}
}
cout << ans << endl;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool is_run(int y) {
if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {
return true;
}
return false;
}
int main() {
int y, m;
cin >> y >> m;
if (is_run(y)) {
days[2] = 29;
}
cout << days[m] << endl;
return 0;
}
二级
三级
四级
五级
六级
七级
八级