Import java. util. collections;
/*
* How many days is the current year for a month in 2013?
* What is the day of the week? It is known that New Year's Day in 2013 is Tuesday.
*/
Public class Test2 {
Public static void main (string [] ARGs ){
Int month, day;
Int monthday = 0;
Boolean n = true;
Wrote input = new partition (system. In );
System. Out. println ("Enter the date of a month in December 2013 :");
Month = input. nextint ();
Day = input. nextint ();
If (month = 1 | month = 3 | month = 5 | month = 7 | month = 8
| Month = 10 | month = 12 ){
If (day> 0 & day <= 31 ){
Monthday = monthday + Day;
} Else {
N = false;
}
} Else if (month = 4 | month = 6 | month = 9 | month = 11 ){
If (day> 0 & day <= 30 ){
Monthday = monthday + Day;
} Else {
N = false;
}
} Else if (month = 2 ){
If (day> 0 & day <= 28 ){
Monthday = monthday + Day;
} Else {
N = false;
}
} Else {
N = false;
}
For (INT I = 0; I <month; I ++ ){
If (I = 1 | I = 3 | I = 5 | I = 7 | I = 8 | I = 10
| I = 12 ){
Monthday = monthday + 31;
} Else if (I = 4 | I = 6 | I = 9 | I = 11 ){
Monthday = monthday + 30;
} Else if (I = 2 ){
Monthday = monthday + 28;
}
}
If (n ){
System. Out. println ("2013" + month + "month" + day + "is the day of the current year"
+ Monthday + "day ");
Switch (monthday % 7 ){
Case 0 :{
System. Out. println ("Monday ");
Break;
}
Case 1 :{
System. Out. println ("Tuesday ");
Break;
}
Case 2 :{
System. Out. println ("Wednesday ");
Break;
}
Case 3 :{
System. Out. println ("Thursday ");
Break;
}
Case 4 :{
System. Out. println ("Friday ");
Break;
}
Case 5 :{
System. Out. println ("Saturday ");
Break;
}
Case 6 :{
System. Out. println ("Sunday ");
Break;
}
Default:
Break;
}
} Else {
System. Out. println ("the input date does not meet the condition ");
}
}
}
Calculate the number of days in a month in the current year?