真的不知道为啥
第一个点是12月,输出是31天,为啥错
#include <iostream>
using namespace std;
short y, m;
short d[12] { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int main()
{
cin >> y >> m;
if(m == 2)
{
if(y % 400 == 0)
{
cout << "29" << endl;
}else if(y % 100 == 0)
{
cout << "28" << endl;
}else if(y % 4 == 0)
{
cout << "29" << endl;
}else
{
cout << "28" << endl;
}
return 0;
}
cout << d[m] << endl;
return 0;
}