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的更多相关文章
随机推荐
- 进度条(progress_bar)
环境:linux.centos6.5 #include<stdio.h> #include<unistd.h> int main() { ]={'\0'}; char ch[] ...
- ASP.NET Core 请求/查询/响应参数格式转换(下划线命名)
业务场景: 在 ASP.NET Core 项目中,所有的代码都是骆驼命名,比如userName, UserName,但对于 WebApi 项目来说,因为业务需要,一些请求.查询和响应参数的格式需要转换 ...
- WCF学习笔记一之通过配置web.config可以通过http访问接口
一.准备 这里涉及到三个文件,现在只是简单的把代码贴出来,后面再详细的讲一下. 三个文件分别是(都是wcf服务应用程序项目下的): 1.IService1.cs 2.Service1.svc 3.We ...
- WPF 绘制曲线图
之前一直用GDI绘图,后面公司要求使用WPF,网上WPF资料太少(可能自己没找到吧),自己写了个测试用,可以拖动. 前端代码 <Window x:Class="Wpf绘图.Window ...
- 【BZOJ】 Hash Killer I II III
前言 这里只是一个整理... Solution Hash Killer I Hash Killer II
- 宽字符————_T、_TEXT、L、TEXT之间的区别
_T._TEXT.L.TEXT之间的区别 在分析前先对三者做一个简单的分类 _T._TEXT.TEXT三者都是根据编译器的环境进行ANSI/UNICODE变换的,_T和_TEXT是根据_UNICODE ...
- Mac OS 中安装 autoconf 和 automake
在Mac上面编译FFmpeg需要安装很多东西,首先是:autoconf 和 automake 请按照以下顺序安装: curl -O http://mirrors.kernel.org/gnu/m4/m ...
- 详解Android数据存储技术
前言 学习Android相关知识,数据存储是其中的重点之一,如果不了解数据,那么让你跟一款没有数据的应用玩,你能玩多久呢?答案是这和没有手机几乎是差不多的.我们聊QQ,聊微信,看新闻,刷朋友圈等都是看 ...
- vscode 编辑器常用快捷键
最近,打算换个编辑器,而 vscode 是一个不错的选择.大部分快捷键和 sublime 还是很像的,但有些也不一样.特此整理一份小笔记. 参考: vscode: Visual Studio Code ...
- LDA-线性判别分析(四)其他几个相关问题
本来是要调研 Latent Dirichlet Allocation 的那个 LDA 的, 没想到查到很多关于 Linear Discriminant Analysis 这个 LDA 的资料.初步看了 ...