Traditional Culture Encyclopedia - The 24 Solar Terms - C# or java demo for calculating birthdays.
C# or java demo for calculating birthdays.
Use the system; Use the system. Assemble. Generics; Use the system. Component model; Use the system. Data; Use the system. Drawing; Use the system. Linq uses the system. Text; Use the system. Windows. Forms namespace brithdayeight {public partial classform1:form {public form1() {initializecomponent (); } Gong Jingxian [] date = {"Jia Zi", "Yi Chou", "Bing Yin", "Ding Mao", "Chen Wu", "Keith", "Geng Wu", "Xin Wei", "Ren Shen", "Gui You", "Jiawu" and "Yihai". Xin Si, Ren Wu, Gui Wei, Shen Jia, Yi You, Bing Xu, Ding Hai, Woods, Ji Chou, Geng Yin, Xin Mao, Ren Chen, Gui Si, etc. Chen Jia, Yisi, Wu Bing, Ding Wei, Wu Shen, Yiyou, Geng Xu, Xinhai, Renzi, Ghost Story, Jiayin, Ipoh, Chen Bing, etc. public int yearZi = 0; Private void btnOk_Click (object sender, EventArgs e) {DateTime dt=Day. Value; int year=dt。 Year; int moon = dt。 Month; int date = dt。 DayOfYearMessageBox。 show(" Test:"+(year % 60-3)+":"+moon+":"+date); //Call the method of obtaining the birth date string yearZi = yearZ(year); String moonZi = moonZ (month, year); String dayZi = dayei (year, date); int hour = int。 Resolution (hour date. Text); String hourZi= Hours (hour, date, year); txtBrithday。 text = yearZi+" "+moonZi+" "+dayZi+" "+hourZi; } private void form1_ load (object sender, event arsene) {}//Method of obtaining the public string yearz (int y) {int yearzie = yearnum (y) of birth date; Return date [yearzie-1]; } public string moonZ(int m, int year) {int yearzie = yearnum (year); if(yearZie & gt; =12) {if (yearzie%10 = = 6 || yearzie%10 = =1) {return date [2+m-1]; } else if(yearZie % 10 = = 2 | | yearZie % 10 = = 7){ return date[ 14+m- 1]; } else if (yearzie%10 = = 3 || yearzie%10 = = 8) {return date [26+m-1]; } else if (yearzi%10 = = 4 || yearzi%10 = = 9) {return date [38+m-1]; } else if(yearZie % 10 = = 5 | | yearZie % 10 = = 0){ return date[50+m- 1 & gt; 60 ? (m- 1 1):49+m】; } } else { if(year zie = = 6 | | year zie = = 1){ return date[2+m- 1]; } else if (yearzie = = 2 || yearzie = = 7) {Return date [14+m-1]; } else if (yearzie = = 3 | yearzie = = 8) {return date [26+m-1]; } else if (yearZi == 4 || yearZi == 9) {return date [38+m-1]; } else if(yearZie = = 5 | | yearZie = = 10){ return date[50+m- 1 & gt; 60? (m- 1 1):49+m】; }} Return date [1]; } public string dayei(int year, int day) {int yearzie = yearnum (year); Return date [(yearzie+day)% 60-1]; } public string Hours(int hour, int day, intyear) {intyearzie = yearnum (year); string strH =int datey =(yearZie+day)% 60- 1; int dateZi = datey % 10; if(datezi = = 1 | | datezi = = 5){ strh+= " A "; } else if(datezi = = 2 | | datezi = = 6){ strh+= " c "; } else if(datezi = = 3 | | datezi = = 7){ strh+= " e "; } else if (datezi = = 4 || datezi = = 8) {strh+= "Geng"; } else if (datezi = = 5 || datezi = = 0) {strh+= "nonyl"; } If (hours & gt0 & hours & lt =1) {strh+= "son"; } else if(hour & gt; 1。 & hours & lt= 3) {strH += "ugly"; } else if(hour & gt; 3 & amp& amp hours & lt= 5) {strH += "Yin"; } else if(hour & gt; 5 & amp& amp hours & lt= 7) {strH += "Mao"; } else if(hour & gt; 7 & amp& amp hours & lt= 9) {strH += "Chen"; } else if(hour & gt; 9 & amp& amp hours & lt =11) {strh+= "si"; } else if(hour & gt; 1 1。 & hour & lt= 13) {strH += "noon"; } else if(hour & gt; 13。 & hour & lt =15) {strh+= "not"; } else if(hour & gt; 15 & amp; & hour & lt= 17) {strH += "Shen"; } else if(hour & gt; 17。 & hour & lt= 19) {strH += "son"; } else if(hour & gt; 19 & amp; & hour & lt= 2 1) {strH += "unitary"; } else if(hour & gt; 2 1。 & hours & lt = 23) {strh+= "e"; } else if(hour & gt; 0 & amp& amp hours & lt =1) {strh+= "hai"; } returns strh} public int yearnum (int year) {int yearzie = year% 60-3; if(yearZie & lt; = 0){ yearZie+= 60; } returns yearZie} }}
- Previous article:What does diligence and incorruptibility mean?
- Next article:When is the autumn equinox?
- Related articles
- Is the winter in Qingdao off-season or peak season in 2022? When is the tourist season in Qingdao?
- Jiangyin sacrifices to Jiangyin's anti-Qing public sacrifice.
- How to keep fit in summer solar terms?
- Where to play on Christmas Eve in Beijing?
- Is the tomb of the solstice before or after winter?
- How many turns does it take to tighten the screw with the throttle sleeve connecting rod wrench?
- Which solar term is as long as day and night?
- What small animals on the earth will change before and after the shock?
- Is the solar term hot in long summer?
- Why leap in February?