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的更多相关文章
随机推荐
- 通过MFC设计一个简单的计价程序
1.实验目的 掌握使用MFC应用程序向导创建应用程序的方法. 掌握新建对话框资源的方法. 掌握生成对话框的方法. 2.实验内容 用应用程序创建一个默认的对话框应用程序,在对话框中能进入下一个对话框,在 ...
- CentOS添加明细路由
网络架构图 根据最近为客户设计的网络架构,简单的梳理一个网路架构图,当然实际上的网络架构要比这个架构图复杂的多,咱们这边只是用这个图作为一个简单的示例. 拓扑分析 我们要实现专线两端不同网段的 ...
- Oracle服务器和客户端安装在同一台机器的情况
最近重装了系统,所有的开发环境需要重新部署一下,因此重新安装了Oracle,结果原来没有问题,这一次又碰到了几个问题(tns12154和tns03505),让我好一搞啊.不过又重新对Oracle加深了 ...
- Android NDK学习(四):C/C++层调用JAVA
一.从C/C++层调用JAVA层代码(无参数调用) //在c代码里面调用java代码里面的方法 // java 反射 // 1 . 找到java代码的 class文件 // jclass (*Find ...
- js中的行为委托和无类编程
概述 <你不知道的JavaScript>中有这么一段话:不幸的是,将类和继承的设计模式思维带入Javascript的想法是你所做的最坏的事情,因为语法可能会让你迷惑不已,让你以为真的有类这 ...
- 从app上传图片到php,再上传到java后端服务器的方法一条龙服务
在现在的网络开发中,上传图片类的需求实在是太普通不过了,但是对于怎么样做到上传图片,对于刚开始建立项目的时候,还是有点不知所措的.也许有幸,我们做的项目是之前已经有人写过类似的用例了,那么我们只需要依 ...
- Iptables-redhat/centos
6用iptables 7默认用firewalld firewalld 与 iptables 过滤点,表 做nat是使用postrouting,prerouting表 Samba服务所使用的端口和协议: ...
- Linux下MySQL的简单操作
Linux下MySQL的简单操作 更改mysql数据库root的密码 首次进入数据库是不用密码的: [root@localhost ~]# /usr/local/mysql/bin/mysql -ur ...
- Linux - 参考链接
01 - Linux系统监控的Shell脚本 常用的主机监控Shell脚本 使用Shell脚本对Linux系统和进程资源进行监控 02 - Linux系统结构 Linux 系统结构详解 03 - Li ...
- 机器学习技法笔记:05 Kernel Logistic Regression
Roadmap Soft-Margin SVM as Regularized Model SVM versus Logistic Regression SVM for Soft Binary Clas ...