此题非常水,不做说明。

package practice;

import java.io.BufferedInputStream;
import java.util.Scanner; /**
* @author caiyu
* @date 2014-12-2
*/
public class POJ1008 {
static final String[] HaabMonth = new String[] { "pop", "no", "zip",
"zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac",
"ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet" };
static final String[] TzolkinMonth = new String[] { "imix", "ik", "akbal",
"kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok",
"chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab",
"canac", "ahau" }; /**
* @param args
*/
public static void main(String[] args) { Scanner cin = new Scanner(new BufferedInputStream(System.in));
int t = cin.nextInt();
for (int i = 0; i < t; i++) {
float d = cin.nextFloat();
String m = cin.next();
int y = cin.nextInt();
System.out.println(convert(d, m, y));
}
} private static String convert(float d, String m, int y) {
int md = 0;
for (int i = 0; i < HaabMonth.length; i++) {
if (HaabMonth[i].equals(m)) {
md = i * 20;
}
}
int days = y * 365 + (int) d + md;
return days % 13 + 1 + " " + TzolkinMonth[days % 20] + " " + days / 260;
}
}

算法:POJ1008 Maya Calendar的更多相关文章

  1. POJ1008 Maya Calendar

    题目来源:http://poj.org/problem?id=1008 题目大意: Maya人认为一年有365天,但他们有两种日历.一种叫做Haab,有19个月.前18个月每月20天,每个月的名字分别 ...

  2. [POJ] #1008# Maya Calendar : 字符处理/同余问题

    一. 题目 Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 74085   Accepted: 2 ...

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

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

  4. POJ 1008 Maya Calendar

    链接:http://poj.org/problem?id=1008 Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Subm ...

  5. Maya Calendar 分类: POJ 2015-06-11 21:44 12人阅读 评论(0) 收藏

    Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 70016   Accepted: 21547 D ...

  6. Poj OpenJudge 百练 Bailian 1008 Maya Calendar

    1.Link: http://poj.org/problem?id=1008 http://bailian.openjudge.cn/practice/1008/ 2.content: Maya Ca ...

  7. B - Maya Calendar(第二季水)

    Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old ...

  8. POJ 1008 Maya Calendar / UVA 300【日期转换/常量数组】

    Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 82431 Accepted: 25319 Descr ...

  9. [POJ 1008] Maya Calendar C++解题

        Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 62297   Accepted: 192 ...

随机推荐

  1. 判断是否字符串是否是JSON

    很多PHPER在开发中数据交互时用的JSON格式,但是没有做很严格的校验,比如一个串是否是正确的json而直接json_decode($str,true), 个人建议在decode前做下校验,防止因为 ...

  2. margin 碰到过的重叠问题

    双倍margin 稍微记录一下,因为常忘 float + margin,实际边距会变成设置值的双倍. 解决办法是 将元素设为 display:inline 最好要了解 IE的 haslayout 问题 ...

  3. lightoj 1427 - Substring Frequency (II) AC自动机

    模板题,找来测代码. 注意有相同单词 //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<c ...

  4. VBA使用的Randomize和DoEvents

    Randomize private function getInt() dim n,m as integer Randomize n=1 m=3 getInt=Int((m+1-n)*rnd + n) ...

  5. Html命名锚

    这个有什么用 案例 参考资料 这个有什么用 嘛, 不管写博客,还是公司的wiki,一般开头都会有个目录什么的, 这时候命名描就有用了, 所谓的描就是书签. 案例 比如这篇博客的目录,首先建立一个无序列 ...

  6. TCP/IP协议和HTTP协议 浩哥指教

    TCP和IP在HTTP协议的上层,HTTP算是应用层,IP协议建立的是电脑跟电脑之间的联系,具体过程是,物理上,通过网线,解析MAC地址,到达路由,路由告诉数据将要去哪里,对方电脑通过NDS解析,解析 ...

  7. js打开新页面

    var PostNewPage=function (url, params) { var temp_form = document.createElement("form"); t ...

  8. netty学习

    1.不选择java原生nio的原因   (1)nio的类库和api繁杂   (2)需要具备其他的额外的技能做铺垫,例如熟悉java多线程编程.   (3)可靠性能力补齐的工作量和难度都非常大,例如客户 ...

  9. CSS布局技巧 -- sticky属性

    在一些很长的表格中,往往需要使用表头悬浮的设计以方便用户使用,例如H5电商页面通过下滑展示大量商品列表时,顶部的导航栏需要在离开屏幕时,需要固定在屏幕顶部以方便用户筛选类别.这种效果一直以来需要通过J ...

  10. Maven中配置默认JDK版本

    使用Maven构建项目时,默认是使用jdk1.3版本,目前很多使用泛型的项目肯定是无法通过编译,除了修改项目的pom文件外,还可以在Maven的配置文件settings.xml中添加如下配置来解决: ...