题意:两种纪年方法的转换

水题,根据题目翻译成代码就可以了

居然WA了一次,避坑,output要先输出数据组数,痛心疾首啊!本来可以一次AC的。

 package poj.ProblemSet;

 import java.util.Scanner;

 public class poj1008 {
public static final String[] Tzolkin_day = {"", "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; public static int Month(String month) {
if (month.equals("pop")) return 0;
if (month.equals("no")) return 1;
if (month.equals("zip")) return 2;
if (month.equals("zotz")) return 3;
if (month.equals("tzec")) return 4;
if (month.equals("xul")) return 5;
if (month.equals("yoxkin")) return 6;
if (month.equals("mol")) return 7;
if (month.equals("chen")) return 8;
if (month.equals("yax")) return 9;
if (month.equals("zac")) return 10;
if (month.equals("ceh")) return 11;
if (month.equals("mac")) return 12;
if (month.equals("kankin")) return 13;
if (month.equals("muan")) return 14;
if (month.equals("pax")) return 15;
if (month.equals("koyab")) return 16;
if (month.equals("cumhu")) return 17;
return 18;//if(month=="uayet")
}
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int n = cin.nextInt();
System.out.println(n);
for (int i = 1; i <= n; i++) {
int day = (int) cin.nextDouble();
String month = cin.next();
int year = cin.nextInt();
int x = (year * 365 + Month(month) * 20 + day);
int a = x % 13 + 1;
String b = Tzolkin_day[x % 20 + 1];
int c = (int) x / (13 * 20);
System.out.println(a + " " + b + " " + c);
}
}
}

Java-POJ1008-Maya Calendar的更多相关文章

  1. POJ1008 Maya Calendar

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

  2. 算法:POJ1008 Maya Calendar

    此题非常水,不做说明. package practice; import java.io.BufferedInputStream; import java.util.Scanner; /** * @a ...

  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] #1008# Maya Calendar : 字符处理/同余问题

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

  7. Poj OpenJudge 百练 Bailian 1008 Maya Calendar

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

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

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

  9. Java中的Calendar方法

    /** * @Title:JavaDate.java * @Package:com.yhd.chart.model * @Description:Java中的Calendar总结 * @author: ...

  10. Java中的Calendar日历用法详解

    第一部分 Calendar介绍 public abstract class Calendar implements Serializable, Cloneable, Comparable<Cal ...

随机推荐

  1. Html5学习系列

    Html5学习系列 HTML5 规定了一种通过 video 元素来包含视频的标准方法 Ogg = 带有 Theora 视频编码和 Vorbis 音频编码的 Ogg 文件 MPEG4 = 带有 H.26 ...

  2. P2710 数列[fhq treap]

    调了一辈子的fhq treap- 如果不会最大子段和 如果不会fhq treap 7个操作- 其中三个查询 单点查询其实可以和区间查询写成一个( fhq treap 的修改操作大概就是 \(split ...

  3. PAT (Advanced Level) Practice 1008 Elevator (20 分) (模拟)

    The highest building in our city has only one elevator. A request list is made up with N positive nu ...

  4. JDK下载安装与环境变量配置图文教程【超详细】

    JDK下载安装与环境变量配置图文教程[超详细] 创建时间:2019年11月13日11时02分 文章目录 1. JDK介绍 1.1 什么是JDK? 1.2 JDK版本介绍 2. JDK下载与安装 3.w ...

  5. 你这是virus吧?

    谁在我的vps上跑了这个?我的备份终于起一定作用了. GO declare @sql varchar(8000) while (select count(*) from sysobjects wher ...

  6. 1级搭建类109-Oracle 12cR2 SI FS(Windows Server 2019)公开

    Oracle 12cR2 单实例文件系统在Windows Server 2019上的安装 在线查看

  7. JavaScript 中的构造函数

    典型的面向对象编程语言(比如C++和Java),存在“类”(class)这个概念.所谓“类”就是对象的模板,对象就是“类”的实例.但是,在JavaScript语言的对象体系,不是基于“类”的,而是基于 ...

  8. 探索drf执行流程之APIView源码分析

    Django REST framework 简介 现在新一代web应用都开始采用前后端分离的方式来进行,淘汰了以前的服务器端渲染的方式.而实现前后端分离是通过Django REST framework ...

  9. 19、vue部署路由模式

    vue-router 默认 hash 模式 -- 使用 URL 的 hash 来模拟一个完整的 URL,于是当 URL 改变时,页面不会重新加载. hash模式带#号 不用配置服务器 如果不想要很丑的 ...

  10. VSCode配置之open-with-Live-Server 无法打开浏览器【解决方法】

    如果你的vscode编辑器打开浏览器时默认打开的是iE,想要把它改为chrome,怎么办呢? 我遇到如下原因: 这是按照网上的setting.json配置 这是运行了 open-with-live-s ...