#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. Android 带password输入界面的Dialog实现机制

    1.布局实现: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:andr ...

  2. adb shell top

    PID:进程在系统中的ID CPU% - 当前瞬时所以使用CPU占用率 #THR - 程序当前所用的线程数 UID - 运行当前进程的用户id Name - 程序名称android.process.m ...

  3. asp.net个人笔记

    1.进程外session一记 配置进程外session, 在webconfig中配置<sessionState timeout="60" mode="StateSe ...

  4. Jmeter 发送json{Jfinal 接口req rsp均为json}

    链接地址:http://yangyoupeng-cn-fujitsu-com.iteye.com/blog/2013649 使用jmeter发送json数据.方法有三种 原创,转载请注明出处 1.利用 ...

  5. ThinkPHP第七天(F函数使用,项目分组配置,项目分组模板文件放置规则配置)

    1.F(文件名称,写入数据,写入地址),用于将数据写入至磁盘文件中,如F('Data',$arr,'./Data/'),作用是将$arr写入至网站根目录的Data文件夹中的Data.php中. 2.读 ...

  6. seajs + easyui [转]

    * *content seajs+easyui使用 */ /** * 首先来看看在seajs中jquery和jquery插件如何使用 */ 1.jquery.js define(function(re ...

  7. hdoj 1013

    比较坑的一道题...直接做肯定WA http://acm.hdu.edu.cn/showproblem.php?pid=1013 #include<iostream> #include&l ...

  8. QComboBox 添加图片(自带addItem函数就有这个功能,从没有注意过)

    方法:    使用 QComboxBox::addItem(QIcon, QString); 示例: 点击(此处)折叠或打开 QComboBox *combo_status = new QComboB ...

  9. Lua,Lua API,配置文件

    想像一个场景:你的c程序须要有一个窗体,你想让用户能够自己定义窗体大小.方法非常多.比方使用环境变量,或键值对的文件. 无论如何,你须要解析它. 使用lua配置文件是个不错的选择. 首先,你能够定义例 ...

  10. H面试程序(15): 冒泡排序法

    #include<stdio.h> #include<assert.h> void display(int * a, int n) { for(int i = 0; i < ...