》》》点我查看「视频」详解》》》
AC_Code
#include <bits/stdc++.h>
using namespace std;int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int main()
{int y, m;cin >> y >> m;if(m != 2) cout << month[m];else{bool f;if(y % 4 == 0 && y % 100 != 0 || y % 400 == 0) f = 1;else f = 0;cout << month[2] + f;}return 0;
}
》》》点我查看「视频」详解》》》