Traditional Culture Encyclopedia - The 24 Solar Terms - How to get solar terms java
How to get solar terms java
/**
*
*/
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:Which county does "the first county in the world" refer to?
- Next article:Ford maverick turned off after cleaning the throttle.
- Related articles
- What are the climate laws in New Zealand?
- [Greeting Mom and Dad from winter solstice] Greeting Mom and Dad in the New Year.
- Restaurant painting solar terms
- What is the key principle of phenological health preservation in the great cold in 202 1 24 solar terms?
- Are the 24 solar terms in China based on the lunar calendar or the solar calendar?
- What are Jordan air cushion shoes? Exaggerated advertisements in basketball magazines. A child put on Jordan air cushion shoes. He can dunk.
- How to write the 24 solar terms table?
- When will the nine days in 2022 begin? Nine solar terms schedule for 2022 -2023.
- The initial steps of Taoist magic
- What crops and vegetables do awns grow? What crops and vegetables can mango grow?