poj1008_Maya_Calendar

时间:2022-11-02 22:47:32

历法的转换。

 #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. Python笔记-第一天

      1.Python的输出print函数要把输出的字符串用单引号或者双引号括起来,但是不能混用. 比如print('hello,world')和print("hello,world") ...

    2. 手机升级到iOS10&comma;用Xcode7&period;3进行真机调试方法

      今天发布的正式版的iOS10,手机果断升级了,结果发现Xcode7.3不能真机调试了,原因是Xcode7.3里面没有iOS10的sdk,下面这个压缩包你可以下载下来放在你的Xcode7.3里面,当然了 ...

    3. gem install factory&lowbar;girl

      文章是从个人博客转过来的,  可以直接访问 iwangzheng.com https://github.com/thoughtbot/factory_girl https://github.com/t ...

    4. &lbrack;Effective C&plus;&plus;系列&rsqb;-为多态基类声明Virtual析构函数

      Declare destructors virtual in polymorphic base classes.   [原理] C++指出,当derived class对象经由一个由base clas ...

    5. poj2533--Longest Ordered Subsequence(dp:最长上升子序列)

      Longest Ordered Subsequence Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 33943   Acc ...

    6. 查找附近的wifi密码

      无意之间看到能破解附近wifi密码的诀窍,赶紧存储下来. 1. 首先打开终端 2. 在没有网路的情况下输入: netsh wlan show profiles 结果如下(自己的): 这些'用户配置文件 ...

    7. 走近HTTP协议之一 基本网络概念与理解

      当今的技术领域,开发者人数最为之多的群体便是web领域,与之相关岗位的包括前端工程师,后台工程师,移动端开发工程师等等.然而由于受时代浮躁氛围的影响,许多开发者对最为基础的HTTP协议都不甚了解,这也 ...

    8. flume常用组件

      Flume组件 1.   Source NetCat Source:绑定的端口(tcp.udp),将流经端口的每一个文本行数据作为Event输入: type:source的类型,必须是netcat. ...

    9. 20155207 EXP7 EXP8 EXP9 实验补交

      20155207 EXP7 EXP8 EXP9 实验补交 20155207 EXP7 网络欺诈技术防范 20155207 EXP8 Web基础 20155207 <网络对抗> Exp9 W ...

    10. 在js中保存数据

      localStorage: localStorage.setItem("key", "value"); localStorage.getItem("k ...