Poj 1008 Maya calendar

Source: Internet
Author: User
# Include  <  Stdio. h  >  
# Include < String . H >
Char Haabmonth [ 19 ] [ 10 ] = { " Pop " , " No " , " Zip " , " Zotz " , " Tzec " , " XUL " , " Yoxkin " , " Mol " , " Chen " , " Yax " , " Zac " , " CEH " , " Mac " , " Kankin " , " Muan " , " Pax " , " Koyab " , " Cumhu " , " Uayet " };
Char Hollyday [ 20 ] [ 10 ] = { " Imix " , " Ik " , " Akbal " , " Kan " , " Chicchan " , " CIMI " , " Manik " , " Lamat " , " Muluk " , " OK " , " Chuen " , " EB " , " Ben " , " IX " , " Mem " , " CIB " , " Caban " , " Eznab " , " Canac " , " Ahau " };
Void Work ( Int Haabd, Char * Haabm, Int Year ){
Int I, days; // Days HAAB calendar days
For (I = 0 ; Strcmp (haabm, haabmonth [I]); ++ I ); // Find a month in the habb calendar
Days = I * 20 + Haabd;
Days + = Year * 365 ;
Printf ( " % D % S % d \ n " , 1 + Days % 13 , Hollyday [days % 20 ], Days / 260 ); // This question is really dizzy in English. I still know mod13 only after reading the problem-solving report. I can learn English well !!
Return ;
}
Int Main (){
Int Number;
Scanf ( " % D " , & Number );
Printf ( " % D \ n " , Number );
For ( Int I = 0 ; I < Number; ++ I ){
Int Haabd, year;
Char Haabm [ 10 ];
Scanf ( " % D. % S % d " , & Haabd, haabm, & Year );
Work (haabd, haabm, year );
}
Return 0 ;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.