#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
char a[][] = {"Jia", "Yi", "Bing", "Ding", "Wu", "Ji", "Geng", "Xin", "Ren" , "Gui"};
char b[][] = {"zi", "chou", "yin", "mao", "chen", "si", "wu", "wei", "shen", "you", "xu" , "hai"};
int i,j,flag_a,flag_b,t,num,sample_Value;
scanf("%d",&t);
sample_Value = ;
while(t--){
flag_a = ;
flag_b = ;
scanf("%d",&num); if(num < ) num++; if(num >= sample_Value){
num -= sample_Value;
flag_a = (flag_a + num) % ;
flag_b = (flag_b + num) % ;
printf("%s%s\n",a[flag_a],b[flag_b]);
}
else{
int temp = sample_Value - num;
while(temp--){
flag_a --;
if(flag_a < ){
flag_a +=;
flag_a %= ;
}
flag_b--;
if(flag_b < ){
flag_b += ;
flag_b %= ;
}
}
printf("%s%s\n",a[flag_a],b[flag_b]);
}
}
return ;
}

ZOJ 3594 年份水题 【注意:没有0年】的更多相关文章

  1. POJ 1837 Balance 水题, DP 难度:0

    题目 http://poj.org/problem?id=1837 题意 单组数据,有一根杠杆,有R个钩子,其位置hi为整数且属于[-15,15],有C个重物,其质量wi为整数且属于[1,25],重物 ...

  2. zoj 3809 枚举水题 (2014牡丹江网赛 A题)

    题目大意:给出一列取样的几个山的高度点,求山峰有几个? Sample Input 291 3 2 4 6 3 2 3 151 2 3 4 5Sample Output 30 # include < ...

  3. ZOJ 2679 Old Bill ||ZOJ 2952 Find All M^N Please 两题水题

    2679:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1679 2952:http://acm.zju.edu.cn/onli ...

  4. 构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root

    题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algori ...

  5. ytu 1059: 判别该年份是否闰年(水题,宏定义)

    1059: 判别该年份是否闰年 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 222  Solved: 139[Submit][Status][Web ...

  6. 水题 ZOJ 3875 Lunch Time

    题目传送门 /* 水题:找排序找中间的价格,若有两个,选价格大的: 写的是有点搓:) */ #include <cstdio> #include <iostream> #inc ...

  7. 水题 ZOJ 3876 May Day Holiday

    题目传送门 /* 水题:已知1928年1月1日是星期日,若是闰年加1,总天数对7取余判断就好了: */ #include <cstdio> #include <iostream> ...

  8. 水题 ZOJ 3880 Demacia of the Ancients

    题目传送门 /* 水题:) */ #include <cstdio> #include <iostream> #include <algorithm> #inclu ...

  9. 水题 ZOJ 3869 Ace of Aces

    题目传送门 水题,找出出现次数最多的数字,若多个输出Nobody //#include <bits/stdc++.h> //using namespace std; #include &l ...

随机推荐

  1. 1.23 确定一个Decimal或Double的整数部分

    知识点: 1.System.Math.PI 2.System.Math.Truncate() //取整 问题: 需要找出一个decimal 或 double数的整数部分. 解决方案 只要将一个deci ...

  2. pre标签 首行会自动换行解决方案

    利用pre标签可以 解决文本文档里面的空格及换行在页面上不显示的方案, 自行换行 加 white-space: pre-wrap; word-wrap: break-word; 英文字母换行 word ...

  3. linux cmd: netstat

    每天一个linux命令:netstat  http://www.cnblogs.com/peida/archive/2013/03/08/2949194.html netstat命令用于显示与IP.T ...

  4. BZOJ 1019: [SHOI2008]汉诺塔( dp )

    dp(x, y)表示第x根柱子上y个盘子移开后到哪根柱子以及花费步数..然后根据汉诺塔原理去转移... ------------------------------------------------ ...

  5. Android中利用httpclient进行网络通信的方法(以用户登录为例说明)

    http://www.android100.org/html/201406/09/22915.html 1.服务器端 服务器端和android没有太大关系,对J2EE比较熟悉的话写起来应该很容易,这里 ...

  6. (IOS)数据持久化

    1.属性列表序列化 2.模型对象归档 3.嵌入式SQLite3 4.Core Data 5.应用程序设置 6.UIDocument管理文档存储 7.iCloud Demo界面: 1.属性列表序列化 即 ...

  7. Linux下同步工具inotify+rsync使用详解

    1. rsync 1.1 什么是rsync rsync是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件.它使用所谓的“Rsync演算法”来使本地和远程两个主机之间的文件达到同步,这 ...

  8. Ubuntu上用premake编译GDAL

    GDAL的编译脚本呈现出不同平台不同解决方案的百花齐放现状.我是从windows平台开始编译GDAL的,用的自然是nmake.那就是一种每个目录下都需要写makefile文件的构建方法,写的人麻烦,我 ...

  9. iOS/Xcode异常:reason = “The model used to open the store is incompatible with the one used to create the store”

    reason=The model used to open the store is incompatible with the one used to create the store 出现上述异常 ...

  10. zIndex属性在IE中无效

    在ie中他的子类的zindex就以父类为准: <!doctype html> <html> <head> <meta charset="utf-8& ...