更新时间2019-12-23 07:57:34
程序
private void Button3_Click(object sender, EventArgs e)
{
int year = Convert.ToInt32(textBox1.Text);
int month= Convert.ToInt32(textBox2.Text);
int []n =new int[]{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
if (month == 2 && (((year % 4 == 0) && (year % 100 != 0)) || year % 400 == 0))
n[1]++;
label1.Text = n[month - 1].ToString();
}
结果