ZOJ 3594 年份水题 【注意:没有0年】
#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年】的更多相关文章
- POJ 1837 Balance 水题, DP 难度:0
题目 http://poj.org/problem?id=1837 题意 单组数据,有一根杠杆,有R个钩子,其位置hi为整数且属于[-15,15],有C个重物,其质量wi为整数且属于[1,25],重物 ...
- zoj 3809 枚举水题 (2014牡丹江网赛 A题)
题目大意:给出一列取样的几个山的高度点,求山峰有几个? Sample Input 291 3 2 4 6 3 2 3 151 2 3 4 5Sample Output 30 # include < ...
- 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 ...
- 构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root
题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algori ...
- ytu 1059: 判别该年份是否闰年(水题,宏定义)
1059: 判别该年份是否闰年 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 222 Solved: 139[Submit][Status][Web ...
- 水题 ZOJ 3875 Lunch Time
题目传送门 /* 水题:找排序找中间的价格,若有两个,选价格大的: 写的是有点搓:) */ #include <cstdio> #include <iostream> #inc ...
- 水题 ZOJ 3876 May Day Holiday
题目传送门 /* 水题:已知1928年1月1日是星期日,若是闰年加1,总天数对7取余判断就好了: */ #include <cstdio> #include <iostream> ...
- 水题 ZOJ 3880 Demacia of the Ancients
题目传送门 /* 水题:) */ #include <cstdio> #include <iostream> #include <algorithm> #inclu ...
- 水题 ZOJ 3869 Ace of Aces
题目传送门 水题,找出出现次数最多的数字,若多个输出Nobody //#include <bits/stdc++.h> //using namespace std; #include &l ...
随机推荐
- HDU 4859(Bestcoder #1 1003)海岸线(网络流之最小割)
题目地址:HDU4859 做了做杭电多校,知识点会的太少了.还是将重点放在刷专题补知识点上吧,明年的多校才是重点. 这题题目求的最长周长.能够试想一下,这里的海岸线一定是在"."和 ...
- js中函数参数基本类型和引用类型的区别
高级程序设计中说明,所有函数的参数都是按值传递的. 基本类型 向参数传递基本类型的值时,被传递的值会被复制给对应的命名参数 function addTen(num){ num=+10; return ...
- 条款05:了解C++默默编写并调用哪些函数
每一个class都会有一个或多个构造函数.一个析构函数.一个copy assignment操作符.这些控制着基础操作,像是产出新对象并确保它被初始化.摆脱旧对象并确保它被适当清理.以及赋予对象新值. ...
- office2013破解工具
终于找到破解工具了,每次打开word文档都弹出限期激活对话框,真的是相当烦躁啊,先把破解工具奉上!!!! 工具名: HEU-KMS-ActivatorV1.1绿色版 链接: office2013 和 ...
- 英文:known good board ( KGB) / 中文:测试用标准板,黄金板
作为标准部件提供的.完全符合设计电气性能的在制板,可以作为与其它印制板比较的标准.
- perl学习(4) 子程序
子程序,类比c语言中的函数,在形式上个人认为最大的区别:没有形参 1.1.定义子程序 1.2.调用 #! /usr/bin/perl sub marine { $n += 1 ; print &quo ...
- Linux中查看进程及杀死进程命令
Linux中想杀死fcitx进程,然后再重启它. root@www.linuxidc.com:/home/zhangbin# ps -e | grep 'fcitx' 3405 ? 00 ...
- prim模板
]; int n; ][]; ]; int prim(){ int i,j,mi,v; ;i<n;i++){ d[i]=map[][i]; vis[i]=; } ;i<=n;i++){ m ...
- 使用ownCloud在Linux安装你的个人云服务
ownCloud是一个免费开源的软件,用于为分享文件,日历,联系人,书签和个人音频/视频.非常容易安装和管理. 前提 在这篇教程里我使用CentOS 6.5 minimal server来安装ownC ...
- .htaccess文件设置
1.为使.htaccess有效,需要先做httpd.conf设置 #打开改写模式Options FollowSymLinks AllowOverride All#打开重写模式,去掉这行注释LoadMo ...