用C#建立一个类,有年和每月最多天数两个属性,要求改变年属性,自动得到每月最多天数属性,写出程序

来源:百度知道 编辑:UC知道 时间:2024/05/24 16:12:33

class cc
{
int year = 2009;
public int Year
{
get { return this.year; }
set { this.year = value; }
}

int month2;
public int Month2
{
get { return DateTime.DaysInMonth(this.year, 2); }
}
}

//只写了取二月的,其他楼主自己发挥

啥题目 改变一下年 要得到每个月的天数?! 这个要求有意义麽?!

r