poj1008_Maya_Calendar
历法的转换。
#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的更多相关文章
随机推荐
- Logs
syslogs Fortinet: http://docs.fortinet.com/fgt.html
- 自己动手写ORM
http://blog.csdn.net/sundacheng1989/article/category/1350100
- bash: ifconfig: command not found
centos下执行ifconfig提示没有该命令 , 试过了网上的一些改path的方案 , 无效.原因是一些工具没有安装啊. 执行如下即可 : yum install net-tools
- 查看MySQL的错误日志的方法
我们经常在运行MySQL时会出一些错误,也经常被这些错误搞得晕头转向.当然解决这些问题的首要任务是找到日志信息. MySQL的错误信息是在data目录下的,且文件名为<hostname>. ...
- DSS 搭建手机流媒体服务器
最近研究了一下手机流媒体服务器的搭建,目的是实现通过3G手机看在线视频. 开始的时候研究了一下 Tudou手机版 ,可它哪并没有实现在线播放,因为视频地址是 http 协议的.参看了许多文章,终于了解 ...
- 基于nginx和uWSGI在Ubuntu上部署Djan
http://www.jianshu.com/p/e6ff4a28ab5a 文/Gevin(简书作者)原文链接:http://www.jianshu.com/p/e6ff4a28ab5a著作权归作者所 ...
- [SQL]分组排练进行更新
--方法(一):分组排练进行更新 ----------------------------------------------------------------------------------- ...
- that-annoying-insert-problem-getting-data-into-the-db-using-dapper
http://samsaffron.com/archive/2012/01/16/that-annoying-insert-problem-getting-data-into-the-db-using ...
- Microsoft Office 2007的ContentType
当从浏览器返回一个文件时,需要指定ContentType,以下是Office2007对应的值: "application/vnd.openxmlformats-officedocument. ...
- JavaScript对象的创建之基于原型方式
原型内存模型介绍 原型是javascript中非常特殊的一个对象,当一个函数创建之后,会随之就产生一个原型对象. 当通过这个函数的构造函数创建一个具体的对象之后,在这个具体的对象中就会有一个属性指向原 ...