首页 > 其他 > 详细

poj 1008

时间:2015-04-08 00:38:35      阅读:356      评论:0      收藏:0      [点我收藏+]

#include<iostream>
#include<string>

using namespace std;
string hname[19] = { "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet" };
string tname[20] = { "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau" };
int main()
{
    int n;
    cin >>n;
    cout <<n <<endl ;
   for (int j = 0; j < n; j++)
    {
        int sum = 0;
        int date,year;
        char c;
        string month;
        cin >> date;
        cin >> c;
        cin >> month>> year;

        if(year) sum += 365*year;
        int i = 0;
         for (int i = 0; i < 19; i++)
        {
            if(month==hname[i])
            {
                sum+=i*20;
                break;
            }
        }

        sum += (date+1);
        cout <<(sum-1)%13+1<<" "<<tname[(sum-1)%20]<<" "<<(sum-1)/260<<endl;



    }
    return 0;

}

poj 1008

原文:http://www.cnblogs.com/lipenglin/p/4400914.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!