C# ACM poj1008

玛雅历

 public static void Acm1008(int day, string mon, int year)
        {
            int m = 0;
            switch (mon)
            {
                case "pop":
                    m = 1;
                    break;
                case "no":
                    m = 2;
                    break;
                case "zip":
                    m = 3;
                    break;
                case "zotz":
                    m = 4;
                    break;
                case "tzec":
                    m = 5;
                    break;
                case "xul":
                    m = 6;
                    break;
                case "yoxkin":
                    m = 7;
                    break;
                case "mol":
                    m = 8;
                    break;
                case "chen":
                    m = 9;
                    break;
                case "yax":
                    m = 10;
                    break;
                case "zac":
                    m = 11;
                    break;
                case "ceh":
                    m = 12;
                    break;
                case "mac":
                    m = 13;
                    break;
                case "kankin":
                    m = 14;
                    break;
                case "muan":
                    m = 15;
                    break;
                case "pax":
                    m = 16;
                    break;
                case "koyab":
                    m = 17;
                    break;
                case "cumhu":
                    m = 18;
                    break;
            }
            day += (m-1) * 20 + year * 365+1;
            int tzolkinY = day / 260;
            int tzolkinB = day % 13;
            int tzolkinDayA = 0;
            switch (tzolkinB)
            {
                case 0:
                    tzolkinDayA = 13;
                    break;
                case 1:
                    tzolkinDayA = 1;
                    break;
                case 2:
                    tzolkinDayA = 2;
                    break;
                case 3:
                    tzolkinDayA = 3;
                    break;
                case 4:
                    tzolkinDayA = 4;
                    break;
                case 5:
                    tzolkinDayA = 5;
                    break;
                case 6:
                    tzolkinDayA = 6;
                    break;
                case 7:
                    tzolkinDayA = 7;
                    break;
                case 8:
                    tzolkinDayA = 8;
                    break;
                case 9:
                    tzolkinDayA = 9;
                    break;
                case 10:
                    tzolkinDayA = 10;
                    break;
                case 11:
                    tzolkinDayA = 11;
                    break;
                case 12:
                    tzolkinDayA = 12;
                    break;
            }
            int tzolkinC = day % 20;
            string tzolkinDayB = "";
            switch (tzolkinC)
            {
                case 1: tzolkinDayB = "imix"; break;
                case 2: tzolkinDayB = "ik"; break;
                case 3: tzolkinDayB = "akbal"; break;
                case 4: tzolkinDayB = "kan"; break;
                case 5: tzolkinDayB = "chicchan"; break;
                case 6: tzolkinDayB = "cimi"; break;
                case 7: tzolkinDayB = "manik"; break;
                case 8: tzolkinDayB = "lamat"; break;
                case 9: tzolkinDayB = "muluk"; break;
                case 10: tzolkinDayB = "ok"; break;
                case 11: tzolkinDayB = "chuen"; break;
                case 12: tzolkinDayB = "eb"; break;
                case 13: tzolkinDayB = "ben"; break;
                case 14: tzolkinDayB = "ix"; break;
                case 15: tzolkinDayB = "mem"; break;
                case 16: tzolkinDayB = "cib"; break;
                case 17: tzolkinDayB = "caban"; break;
                case 18: tzolkinDayB = "eznab"; break;
                case 19: tzolkinDayB = "canac"; break;
                case 0: tzolkinDayB = "ahau"; break;
            }
            Console.WriteLine(tzolkinDayA + " " + tzolkinDayB + " " + tzolkinY);
        }

 

转载于:https://www.cnblogs.com/DhyDream/p/4349577.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值