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

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

  1. #include<cstdio>
  2. #include<cstring>
  3. #include<iostream>
  4. using namespace std ;
  5. int main()
  6. {
  7. int n ;
  8. scanf("%d",&n) ;
  9. printf("%d\n",n);
  10. for(int i = ; i <= n ; i++)
  11. {
  12. int day,year ;
  13. char month[];
  14. scanf("%d",&day) ;
  15. getchar();
  16. cin>>month ;
  17. cin>>year ;
  18. int mon ;
  19. if(strcmp(month,"pop")==) mon = ;
  20. if(strcmp(month,"no")==) mon = ;
  21. if(strcmp(month,"zip")==) mon = ;
  22. if(strcmp(month,"zotz")==) mon = ;
  23. if(strcmp(month,"tzec")==) mon = ;
  24. if(strcmp(month,"xul")==) mon = ;
  25. if(strcmp(month,"yoxkin")==) mon = ;
  26. if(strcmp(month,"mol")==) mon = ;
  27. if(strcmp(month,"chen")==) mon = ;
  28. if(strcmp(month,"yax")==) mon = ;
  29. if(strcmp(month,"zac")==) mon = ;
  30. if(strcmp(month,"ceh")==) mon = ;
  31. if(strcmp(month,"mac")==) mon = ;
  32. if(strcmp(month,"kankin")==) mon = ;
  33. if(strcmp(month,"muan")==) mon = ;
  34. if(strcmp(month,"pax")==) mon = ;
  35. if(strcmp(month,"koyab")==) mon = ;
  36. if(strcmp(month,"cumhu")==) mon = ;
  37. if(strcmp(month,"uayet")==) mon = ;
  38. int days = (year*)+(mon-)*+day;
  39. printf("%d ",days%%+);
  40. int Tdays = days%%+ ;
  41. if(Tdays == ) cout<<"imix";
  42. if(Tdays == ) cout<<"ik";
  43. if(Tdays == ) cout<<"akbal";
  44. if(Tdays == ) cout<<"kan";
  45. if(Tdays == ) cout<<"chicchan";
  46. if(Tdays == ) cout<<"cimi";
  47. if(Tdays == ) cout<<"manik";
  48. if(Tdays == ) cout<<"lamat";
  49. if(Tdays == ) cout<<"muluk";
  50. if(Tdays == ) cout<<"ok";
  51. if(Tdays == ) cout<<"chuen";
  52. if(Tdays == ) cout<<"eb";
  53. if(Tdays == ) cout<<"ben";
  54. if(Tdays == ) cout<<"ix";
  55. if(Tdays == ) cout<<"mem";
  56. if(Tdays == ) cout<<"cib";
  57. if(Tdays == ) cout<<"caban";
  58. if(Tdays == ) cout<<"eznab";
  59. if(Tdays == ) cout<<"canac";
  60. if(Tdays == ) cout<<"ahau";
  61. //int Tyears = (year*365)/260 ;
  62. int Tyears = days/;
  63. cout<<" "<<Tyears<<endl ;
  64. }
  65. return ;
  66. }

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. 【风马一族_git_github】git的工作流程

    git有三个区域(如图): 基本信息设置 1)设置用户名   git config --global user.name  "帐号名" 2)设置用户名邮箱  git config ...

  2. arm汇编指令总结(不断更新)

    /** ****************************************************************************** * @author    Maox ...

  3. (转)HTML5游戏如何挣钱?2条经验让你每款赚3万刀

    原文作者:Alexander Krug,是世界上最大的HTML5游戏平台的运营商SOFTGAMES的CEO. 现今苹果App Store当中的应用数量可以以海量来形容,最新发布的应用对排行榜的冲击力也 ...

  4. CDH JPS 出现没有名字的进程

    jps 时出现没有名字的进程 或者process information unavailable 把服务关掉,执行一下 rm -rf /tmp/hsperfdata_* 再重启就好了.

  5. Jquery 在动态元素上绑定事件

    弄了很久却没有弄出来,感觉没有错,但是动态元素上的事件根本就不响应,代码如下: <input type="button" id="btnyes" valu ...

  6. 表达式语言之EL表达式

    1.EL的用法EL的起源:起源于JSTL.EL运算符: 算术型:+.-.*./.div.%.mod.其中/和div都表示求除.%和mod表示求余数. 逻辑型:and或&&.or或||. ...

  7. VC2010 MFC文档类菜单快捷键无法加载问题

    问题1. 在菜单中项中输入&Run\tF5, 运行显示Run,而不是Run F5. 问题2.在Accelerator中绑定了快捷键,但运行程序不起作用. 以上2中问题在VC++2008和VC+ ...

  8. http概述

    HTTP是一个属于应用层的面向对象的协议,由于其简捷.快速的方式,适用于分布式超媒体信息系统.它于1990年提出,经过几年的使用与发展,得到不断地完善和扩展.目前在WWW中使用的是HTTP/1.0的第 ...

  9. [转]- Winform 用子窗体刷新父窗体,子窗体改变父窗体控件的值

    转自:http://heisetoufa.iteye.com/blog/382684 第一种方法: 用委托,Form2和Form3是同一组 Form2  using System; using Sys ...

  10. cocos2dx中加载图片资源的方法,和从内存中获取已经加载的图片资源的方法

    游戏中通常需要将常用的资源如:声音,图片,plist文件,提前加载进内存,以加快游戏的流畅度 1.预加载声音: SimpleAudioEngine::getInstance()->preload ...