HDU6213
Chinese Zodiac
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 184 Accepted Submission(s): 135
Problem Description
Victoria is married to a younger man, but no one knows the real age difference between the couple. The good news is that she told us their Chinese Zodiac signs. Their years of birth in luner calendar is not the same. Here we can guess a very rough estimate of the minimum age difference between them.
If, for instance, the signs of Victoria and her husband are ox and rabbit respectively, the estimate should be 2 years. But if the signs of the couple is the same, the answer should be 12 years.
Input
For each test case a line of two strings describes the signs of Victoria and her husband.
Output
Sample Input
Sample Output
Source
//2017-09-18
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <map> using namespace std; map<string, int> mp; int main()
{
mp["rat"] = ;
mp["ox"] = ;
mp["tiger"] = ;
mp["rabbit"] = ;
mp["dragon"] = ;
mp["snake"] = ;
mp["horse"] = ;
mp["sheep"] = ;
mp["monkey"] = ;
mp["rooster"] = ;
mp["dog"] = ;
mp["pig"] = ; int T;
cin>>T;
string str1, str2;
while(T--){
cin>>str1>>str2;
int ans = ((mp[str2]-mp[str1])+)%;
if(ans == )ans = ;
cout<<ans<<endl;
} return ;
}
HDU6213的更多相关文章
随机推荐
- 26、TCP服务器原理
TCP / IP的工作 TCP / IP是Internet上使用的网络协议.它是协议,ESP32本身自带了TCP/IP协议,所以,我们只需了解并学会运用即可. 首先,有IP地址.这是一个32位值,应该 ...
- ReactNative学习笔记(三)打包、调试、运行等相关介绍
各种命令 个人习惯在项目根目录下把一些常见命令写成bat文件,以后每次要执行什么只需要双击即可: 编译.生成.运行并启动packager(debug模式): react-native run-andr ...
- 开源播放器 ijkplayer (三) :ijkplayer支持 https 编译流程
主要是为了支持flv和m3u8,使用https播放视频的需求 ./init-android.sh ./init-android-openssl.sh // 增加https协议支持 cd android ...
- centoos内核升级
1.检查当前CentOS内核版本 uname -r 2.导入key 打开http://elrepo.org/tiki/tiki-index.php 复制执行该命令 3.安装ELRepo 打开2步中的网 ...
- 双系统Ubuntu无法访问Win10磁盘分区解决方法
今天在linux下打开win的NTFS硬盘总是提示出错了,而且是全部的NTFS盘都出错,其中sda3错误显示如下: Error mounting /dev/sda3 at /media/struggl ...
- HoloLens开发手记-凝视 Gaze
在全息应用中,凝视是第一种输入形式,被用于定位物体(功能和PC的光标指针类似).凝视告诉你用户正在看向世界中的位置,让你能够确定他们的意图.在现实世界中,你通常会盯着你打算与之交互的物体.这种方式与凝 ...
- spring boot 访问静态资源的步骤
1)resources/static下放置html文件.(或者static下新建目录 http://hcss:8090/imgs/单例.png) 2)webapp下放置html文件. 如果两个路径下有 ...
- Java 基础学习总结(一)抽象类和接口
接触java的时间不是很长,以前对抽象类和接口的定义和区别也是模糊不清,最近拿起学校的教程读了起来,也参阅了网上的博客大神理解和总结,于是决定自己按照自己的理解来总结一下. 抽象类(半成品) 一般 ...
- [原创]MOF提权下载者代码
0x001 网上的mof提权 调用的是js执行添加用户 而且有个缺陷 还不能一步到位...目标3389也连不上...也不知道上面安装了什么软件...毛然添加用户也不好比如有个类似狗之类的拦截添加用户 ...
- jdk8- list操作
本文版权归 远方的风lyh和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. student类 public class Student { private String age; ...