Traditional Culture Encyclopedia - The 24 Solar Terms - Java current solar terms
Java current solar terms
/**
*
*/
Packaging calendar;
Import java.util.scanner;
/**
* perpetual calendar
*
* @ Author Administrator
*
*/
Public course calendar {
/**
* @param args
*/
Public static void main(String[] args) {
Scanner input = new scanner (system. in);
System.out.print ("Please enter year:");
int year = input . nextint();
System.out.print ("Please enter month:");
int months = input . nextint();
int year num = 0;
int sum = 0;
for(int I = 1900; My< year; I++) {// year
if ((i % 4 == 0) || (i % 100! = 0 & amp& ampi % 400 == 0)) {
sum+= 366;
} Otherwise {
sum+= 365;
}
}
boolean isYear = false
If ((year% 4 == 0) || (year% 100! = 0 & amp& ampyear % 400 == 0)) {
isYear = true
}
for(int I = 1; I < = month; I++) {// month
sum+= yern um;
Switch (i) (
Case 1:
Case 3:
Case 5:
Case 7:
Case 8:
Case 10:
Case 12: {
yrenum = 3 1;
Break;
}
Case 4:
Case 6:
Case 9:
Case 1 1: {
yearNum = 30
Break;
}
Case 2: {
if (isYear) {
yearNum = 29
} Otherwise {
yearNum = 28
}
Break;
}
}
}
String[] week = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" and "Saturday"};
for(int I = 0; I< weeks. Length; i++) {
system . out . print(week[I]+" \ t ");
}
system . out . println();
for(int I = 0; I < total% 7; i++) {
system . out . print(" \ t ");
}
for(int n = 1; N< = yearumn++) {//output
if ((sum + n) % 7 == 1) {
system . out . println();
}
system . out . print(n+" \ t ");
}
}
}
- Previous article:A short tweet about Shanghai's tourist attractions.
- Next article:How to draw in the spring of senior one?
- Related articles
- Does Corolla 12t need a computer reset to clean the throttle?
- What happens when the accelerator of the car breaks down?
- A complete collection of agricultural classic proverbs
- What does beginning of autumn eat in solar terms?
- 202 1 When was the panic?
- Are there any sketches on the program of the August 15 party?
- Do you want to match the old POLO after cleaning the throttle?
- Hand-painted Illustration of the Poster of the Year of the Rabbit —— How to draw the Poster of the New Year's Party of the Year of the Rabbit simply and beautifully
- Lotus L3 car can't refuel.
- Hu Jinyong: Take the way of nature and cultivate the body of nature.