历法的转换。

 #include <stdio.h>
#include <math.h>
#include <string.h>
char Haab[][]={
"pop","no","zip","zotz","tzec","xul","yoxkin","mol",
"chen","yax","zac","ceh","mac","kankin","muan","pax",
"koyab","cumhu","uayet"
};
char Tzolkin[][]={
"imix","ik","akbal","kan","chicchan","cimi","manik",
"lamat","muluk","ok","chuen","eb","ben","ix","mem",
"cib","caban","eznab","canac","ahau"
};
int count(int day,char month[],int year){
int tot=;
tot+=(day+);
int i;
for(i=;i<;++i){
if(strcmp(month,Haab[i])==){
tot+=(i*);
break;
}
}
tot+=(year*);
return tot;
}
int main(){
int t,i,tot;
int day,year;
int m;
char month[];
while(~scanf("%d",&t)){
printf("%d\n",t);
for(i=;i<t;++i){
scanf("%d. %s %d",&day,month,&year);
tot=count(day,month,year);
m=(tot-)%;
day=(tot-)%;
day++;
if(day>){
day=(day%)+;
}else
year=(tot-)/;
printf("%d %s %d\n",day,Tzolkin[m],year);
}
}
return ;
}

poj1008_Maya_Calendar的更多相关文章

随机推荐

  1. ios6和ios7禁止屏幕旋转

    ios6和ios7禁止屏幕旋转 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOr ...

  2. ios 开发,通讯录信息调用常用方法,这个比较全,不用再整理了

    ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef results = ABAddressBookCopyArrayOfA ...

  3. channelartlist标签调用实例

    channelartlist标签,大家都知道在DedeCMS的系统中,我们可以用这个标签进行循环子栏目及其栏目的文档数据,这也是DedeCMS系统中,唯一一个支持标签嵌套的调用标签,以DedeV5.6 ...

  4. java小程序 示例

    乘法表: package com.test; import org.junit.Test; public class TestSwitch { @Test public void test() { f ...

  5. [Flex] ButtonBar系列——arrowKeysWrapFocus属性如果为 true,则使用箭头键在组件内导航时,如果击中某一端则将折回。

    <?xml version="1.0" encoding="utf-8"?> <!--arrowKeysWrapFocus 如果为 true, ...

  6. Oracle中增加,修改,删除表中的列

    有些时候,当一个表已经建好,并且已经使用后,发现需要对表结构进行修改,这个时候就要对表中的列进行增删查改操作. 为表增加新列: ALTER TABLE table_name ADD ( column_ ...

  7. CRM IFRAME 显示地图

    作者:卞功鑫  ,转载请保留.http://www.cnblogs.com/BinBinGo/p/5274409.html 需要背景: 现在已经有经纬度,需要在地图上显示出来. 环境: CRM 4.0 ...

  8. Matla学习:figure+axes+plot

    function fig = SetDrawParam() %.获得屏幕尺寸 figpos = , 'ScreenSize');%获得屏幕尺寸,单位像素 %.设置坐标系在画布中的位置,针对不同尺寸或不 ...

  9. LeetCode 107. Binary Tree Level Order Traversal II

    Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left ...

  10. (medium)LeetCode 233.Number of Digit One

    Given an integer n, count the total number of digit 1 appearing in all non-negative integers less th ...