github.com/archlabjp/eeslism-go@v0.0.0-20231109122333-4bb7bfcdf292/eeslism/NENNKANN.go (about) 1 //This file is part of EESLISM. 2 // 3 //Foobar is free software : you can redistribute itand /or modify 4 //it under the terms of the GNU General Public License as published by 5 //the Free Software Foundation, either version 3 of the License, or 6 //(at your option) any later version. 7 // 8 //Foobar is distributed in the hope that it will be useful, 9 //but WITHOUT ANY WARRANTY; without even the implied warranty of 10 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 11 //GNU General Public License for more details. 12 // 13 //You should have received a copy of the GNU General Public License 14 //along with Foobar.If not, see < https://www.gnu.org/licenses/>. 15 16 /* 17 18 年間通日を求める 19 FILE=NENNKANN.c 20 Create Date=1998.8.15 21 22 */ 23 24 package eeslism 25 26 func nennkann(M, D int) int { 27 var n int 28 29 if M == 1 { 30 n = D 31 } else if M == 2 { 32 n = 31 + D 33 } else if M == 3 { 34 n = 31 + 28 + D 35 } else if M == 4 { 36 n = 31 + 28 + 31 + D 37 } else if M == 5 { 38 n = 31 + 28 + 31 + 30 + D 39 } else if M == 6 { 40 n = 31 + 28 + 31 + 30 + 31 + D 41 } else if M == 7 { 42 n = 31 + 28 + 31 + 30 + 31 + 30 + D 43 } else if M == 8 { 44 n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + D 45 } else if M == 9 { 46 n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + D 47 } else if M == 10 { 48 n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D 49 } else if M == 11 { 50 n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D 51 } else if M == 12 { 52 n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D 53 } 54 55 return n 56 } 57 58 /*-----------------------------------------------------*/