#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. [译]Stairway to Integration Services Level 3 - 增量导入数据

    让我们打开之前的项目:My_First_SSIS_Project_After_Step_2.zip 之前项目中我们已经向dbo.contact 导入了19972行,如果再次执行包会重复导入,让我们来解 ...

  2. 自定义cell相关注意事项

    1.拖线成功后,如果又在.h文件或者.m文件里面删除了对应的属性或者方法.一定要在xib文件中,删除关联.方法是:右键点击一下对应的UI控件,把多余的关联叉掉就行了.  不然容易崩溃.

  3. Arduino 跷跷板(2016-01-04)

    前言这是参加社区活动,用赠送的 LilyPad 来做小实验,也体验了一把艺术的LilyPad!本来是申请 nano 的,不知道怎么的就出错啦,申请成 LilyPad 了,这个实验应该用 nano 比较 ...

  4. 「OC」类和对象

    一.面向对象 OC语言是面向对象的,c语言是面向过程的,面向对象和面向过程只是解决问题的两种思考方式,面向过程关注的是解决问题涉及的步骤,面向对象关注的是设计能够实现解决问题所需功能的类. 术语:OO ...

  5. BZOJ 1642: [Usaco2007 Nov]Milking Time 挤奶时间( dp )

    水dp 先按开始时间排序 , 然后dp. dp( i ) 表示前 i 个时间段选第 i 个时间段的最优答案 , 则 dp( i ) = max( dp( j ) ) + w_i ( 0 < j ...

  6. codeforces 623A. Graph and String 构造

    题目链接 给出一个图, 每个节点只有三种情况, a,b, c. a能和a, b连边, b能和a, b, c,连边, c能和b, c连边, 且无重边以及自环.给出初始的连边情况, 判断这个图是否满足条件 ...

  7. nginx启动

    查看nginx的进程 ps -ef | grep nginx 重启nginx的3种办法1.service nginx restart2.改了配置文件让其生效办法 nginx -s reload3.到n ...

  8. OGNL逻辑标签,UI标签

    逻辑标签 public class IndexAction extends BasicAction{ private static final long serialVersionUID = 1L; ...

  9. SpringBoot接口服务处理Whitelabel Error Page(转)

    To switch it off you can set server.error.whitelabel.enabled=false http://stackoverflow.com/question ...

  10. FFmpeg源码结构图 - 解码

    ===================================================== FFmpeg的库函数源码分析文章列表: [架构图] FFmpeg源码结构图 - 解码 FFm ...