此题非常水,不做说明。

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. 2-6 Working with Lambdas

    在C++中使用匿名函数,格式如下:[] () {}; Using a Lambda to Print array Values #include <algorithm> #include ...

  2. VS2012智能提示消失的解决方法

    1.点击电脑左下角的“开始菜单”->"所有程序"->Microsoft Visual Studio 2012->Visual Studio Tools->V ...

  3. survey on Time Series Analysis Lib

    (1)I spent my 4th year Computing project on implementing time series forecasting for Java heap usage ...

  4. Charles

    1. charles使用教程指南+客户端弱网测试:http://blog.csdn.net/anualday/article/details/51423457 2.使用Charles对Https请求进 ...

  5. db2设置共享内存

    db2 UPDATE DBM CFG USING INSTANCE_MEMORY 5242880 IMMEDIATEdb2 UPDATE DBM CFG USING INSTANCE_MEMORY A ...

  6. 用Backbone.js创建一个联系人管理系统(五)

    原文: Build a Contacts Manager Using Backbone.js: Part 5 这是这系列教程最后一部分了. 之前所有的增删改都在前端完成. 这部分我们要把Contact ...

  7. Winform中Grid跨行复制一列

    Private Sub DataCopyToGrid() '判断剪切板中是否存在内容 If Clipboard.ContainsText Then Dim str = Clipboard.GetTex ...

  8. Qt 4.x调试器问题,缺失调试助手。

    之前项目开发需要用到4.x环境,固定多少版本避免团队开发不协调,然后拿了同事的开发包安装[注:我本子上原来就有4.x版本跟5.x版本,只是对应的4.x跟需求的不一样] creator是2.4.1的,同 ...

  9. 用eclipse搭建SSH(struts+spring+hibernate)框架

    声明: 本文是个人对ssh框架的学习.理解而编辑出来的,可能有不足之处,请大家谅解,但希望能帮助到大家,一起探讨,一起学习! Struts + Spring + Hibernate三者各自的特点都是什 ...

  10. 猜字符游戏之java

    package days06; //需求......,问题,为什么要用do{}while???import java.util.Scanner;public class RepeatOfGussing ...