class sumd{
private int year = 0;
private int mon = 0;
private int day = 0;
private int md = 30;
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public int getMon() {
return mon;
}
public void setMon(int mon) {
this.mon = mon;
}
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
int sum = 0;
String c = null;
public int getSum() {
return sum;
}
public void setSum(int sum) {
this.sum = sum;
}
public String getC() {
return c;
}
public void setC(String c) {
this.c = this.week();
}
public boolean trueday() {
if ((mon >= 1 && mon <= 12) && (day >= 1 && day <= 31)) {
return true;
}
return false;
}
public void sumday() {
// System.out.println(this.mon+"哈哈,我找到你");//测试用
switch (this.mon) {
case 1:
md = 31;
break;
case 2:
this.specialyear();
break;
case 4:
md = 30;
break;
case 6:
md = 30;
break;
case 9:
md = 30;
break;
case 11:
md = 30;
break;
default:
md = 31;
break;
}
this.setSum((mon-1) * md + this.day);
// 比如12月,将前11月,乘以对应每月的天数,加上获取到的天数。得出总天数
// System.out.println(md+"此时的md");//测试用
// System.out.println(this.specialyear());//测试用
}
public String week() {
int i = sum % 7;
switch (i) {
case 1:
c = "一";
break;
case 2:
c = "二";
break;
case 3:
c = "三";
break;
case 4:
c = "四";
break;
case 5:
c = "五";
break;
case 6:
c = "六";
break;
case 0:
c = "日";
break;
}
return c;
}
public int specialyear() {
if (this.year % 4 == 0 && (this.year / 100 % 4 == 0))
{
System.out.println(this.year);//测试用
return 29;}
return 28;
}
}
public class Text9 {
public static void main(String[] args) throws IOException {
BufferedReader bufr = new BufferedReader(new InputStreamReader(
System.in));
// 先把这句经典的话写上,放心。