Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

贴个代码,要输出组数,坑了很久……

Posted by shoutz at 2013-04-05 20:26:12 on Problem 1008
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
using namespace std;
int main()
{
    int n;
    string mon1[]={ "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
    string mon2[]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
    while(cin>>n)
    {
        cout<<n<<'\n';
        int i,j;
        int day,year;
        string t;
        for(i=0;i<n;i++)
        {
            cin>>day;
            getchar();
            cin>>t;
            cin>>year;
            for(j=0;j<30;j++)
                if(t==mon1[j])
                break;
            day+=((j)*20+365*year);
            year=day/260;
            j=day%20;
            day%=13;
            cout<<day+1<<" "<<mon2[j]<<" "<<year<<'\n';
        }

    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator