http://poj.org/problem?id=1008&lang=default&change=true

这个题倒是不难,就是麻烦一点,但是还WA了几次都是因为处理天数的时候没处理好,因为Haab这个日历日期是从0开始的,所以当第一年的最后一天第364天,而如果输入的恰好是365天应该是第二年的,所以,那个天数要放在下面处理

 #include<cstdio>
#include<cstring>
#include<iostream>
using namespace std ;
int main()
{
int n ;
scanf("%d",&n) ;
printf("%d\n",n);
for(int i = ; i <= n ; i++)
{
int day,year ;
char month[];
scanf("%d",&day) ;
getchar();
cin>>month ;
cin>>year ;
int mon ;
if(strcmp(month,"pop")==) mon = ;
if(strcmp(month,"no")==) mon = ;
if(strcmp(month,"zip")==) mon = ;
if(strcmp(month,"zotz")==) mon = ;
if(strcmp(month,"tzec")==) mon = ;
if(strcmp(month,"xul")==) mon = ;
if(strcmp(month,"yoxkin")==) mon = ;
if(strcmp(month,"mol")==) mon = ;
if(strcmp(month,"chen")==) mon = ;
if(strcmp(month,"yax")==) mon = ;
if(strcmp(month,"zac")==) mon = ;
if(strcmp(month,"ceh")==) mon = ;
if(strcmp(month,"mac")==) mon = ;
if(strcmp(month,"kankin")==) mon = ;
if(strcmp(month,"muan")==) mon = ;
if(strcmp(month,"pax")==) mon = ;
if(strcmp(month,"koyab")==) mon = ;
if(strcmp(month,"cumhu")==) mon = ;
if(strcmp(month,"uayet")==) mon = ;
int days = (year*)+(mon-)*+day;
printf("%d ",days%%+);
int Tdays = days%%+ ;
if(Tdays == ) cout<<"imix";
if(Tdays == ) cout<<"ik";
if(Tdays == ) cout<<"akbal";
if(Tdays == ) cout<<"kan";
if(Tdays == ) cout<<"chicchan";
if(Tdays == ) cout<<"cimi";
if(Tdays == ) cout<<"manik";
if(Tdays == ) cout<<"lamat";
if(Tdays == ) cout<<"muluk";
if(Tdays == ) cout<<"ok";
if(Tdays == ) cout<<"chuen";
if(Tdays == ) cout<<"eb";
if(Tdays == ) cout<<"ben";
if(Tdays == ) cout<<"ix";
if(Tdays == ) cout<<"mem";
if(Tdays == ) cout<<"cib";
if(Tdays == ) cout<<"caban";
if(Tdays == ) cout<<"eznab";
if(Tdays == ) cout<<"canac";
if(Tdays == ) cout<<"ahau";
//int Tyears = (year*365)/260 ;
int Tyears = days/;
cout<<" "<<Tyears<<endl ;
}
return ;
}

POJ1008Maya Calendar的更多相关文章

  1. 北大ACM(POJ1008-Maya Calendar)

    Question:http://poj.org/problem?id=1008 问题点:日历转换. Memory: 280K Time: 16MS Language: C++ Result: Acce ...

  2. poj 1008:Maya Calendar(模拟题,玛雅日历转换)

    Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 64795   Accepted: 19978 D ...

  3. Java 时间类-Calendar、Date、LocalDate/LocalTime

    1.Date 类 java.util.Date是一个"万能接口",它包含日期.时间,还有毫秒数,如果你只想用java.util.Date存储日期,或者只存储时间,那么,只有你知道哪 ...

  4. Js: Extensible Calendar Examples

    http://ext.ensible.comhttps://github.com/bmoeskau/Extensiblehttps://github.com/TeamupCom/extensibleh ...

  5. Calendar类

    Calendar类 注意:根据日历规则,如果想要这个月减去5天,那么则为: add(Calendar.Day,-5) 成员方法: public int get(int field):返回给定日历段的值 ...

  6. This month Calendar

    package fourth;import java.text.DateFormatSymbols;import java.util.*;public class CalendarTest { pub ...

  7. calendar的一些操作

    一.通过分析日期函数,根据日期进行一系列操作,例如:我们需要知道2个时间段中所有的日期等等. 由于Calendar 类是一个抽象类,因此我们不能通过new来获取该对象的实例.我们可以通过其类方法 ge ...

  8. java-String Date Calendar之间的转换

    1.Calendar 转化 String Calendar calendat = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDa ...

  9. jQuery Ion.Calendar 日期/日历

    在线实例 实例演示 默认 实例演示 每周第一天 实例演示 输入框插件 实例演示 HTML data 属性 实例演示 回调函数1 实例演示 回调函数2 使用方法 <div id="cal ...

随机推荐

  1. win7 php5.5 apache 源码安装 imagick扩展

    最近公司项目有用到php 的imagick,折腾了好长时间才把扩展装上,最主要的就是最新的不一定是最合适的,最开始一直找最新包安装,一直都不成功,经过google了好长时间,终于找到一个有用的,灵机一 ...

  2. FPGA笔记-读取.dat文件

    读取.dat图像文件 .dat文件是matlab生成的图像文件 initial begin // Initialize Inputs CLK = 0; RST = 1; IMAGE_DATA = 0; ...

  3. c++11: bind用法

    原型: template< class R, class F, class... Args > bind( F&& f, Args&&... args ); ...

  4. jquery源码分析学习地址

    http://www.ccvita.com/121.htmljQuery工作原理解析以及源代码示例http://www.cnblogs.com/haogj/archive/2010/04/19/171 ...

  5. 一款jQuery打造的滚动条在底部滑出信息提示层

    一款jQuery打造的滚动条在底部滑出信息提示层, 当滚动鼠标滚轮,或者滚动条往下拉的时候,在右下角,弹出一个信息提示框. 有一点仿的是一个插件工具,就是网页中大家都长用到的友荐. 这款特效算一款简单 ...

  6. Entity Framework Code First 常用方法集成

    using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using S ...

  7. Winform webBrowser 不跳转网页

    private void webBrowser1_NewWindow(object sender, CancelEventArgs e) { string url = ((WebBrowser)sen ...

  8. Application,Session和Cookie

    做ASP.NET,肯定会和这几个对象打交道,这些也是基础面试的常见题目,总结一下还是必要的,好在大神已经总结好了,直接参考就好了: http://www.cnblogs.com/breezeblew/ ...

  9. SQL Server 2012 BI 学习 第一天

    了解数据源,数据源视图,多维数据集,维度 数据源:一个数据库或者其它数据链接,SSAS不支持使用模拟功能来处理 OLAP 对象.模拟信息选择“使用服务帐户” 数据源视图:DSV是元数据的单个统一视图, ...

  10. Golang学习笔记

    一.基础 1. Hello World程序 demo: package main import "fmt" // 注释 //注释 func main() { fmt.Printf( ...