题目链接:HDU6213
菜鸡切水……
ACcode:
/*
2017年9月17日19:32:26
HDU 6213 纯签到
AC
*/
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
using namespace std;
map<string,int> mp;
int main(){
int n;
cin>>n;
mp["rat"]=1;
mp["ox"]=2;
mp["tiger"]=3;
mp["rabbit"]=4;
mp["dragon"]=5;
mp["snake"]=6;
mp["horse"]=7;
mp["sheep"]=8;
mp["monkey"]=9;
mp["rooster"]=10;
mp["dog"]=11;
mp["pig"]=12;
for(int i=1;i<=n;i++){
string a,b;
cin>>a>>b;
int x,y;
x=mp[a];
y=mp[b];
printf("%d\n",(y-x+12)%12==0?12:(y-x+12)%12);
}
return 0;
}