简单题。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std; char a[][]={
"tret","jan", "feb", "mar", "apr", "may", "jun", "jly", "aug", "sep", "oct", "nov", "dec"
}; char b[][]={
"zzz","tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mer", "jou"
}; int main()
{
int n; char s[];
scanf("%d",&n); getchar();
for(int i=;i<=n;i++)
{
gets(s);
if(s[]>=''&&s[]<='')
{
int num=;
for(int i=;s[i];i++) num=num*+s[i]-'';
if(num<=) printf("%s\n",a[num]);
else if(num%==) printf("%s\n",b[num/]);
else printf("%s %s\n",b[num/],a[num%]);
}
else
{
int p=-;
for(int i=;s[i];i++) if(s[i]==' ') p=i;
if(p==-)
{
int num=;
for(int i=;i<=;i++)
if(strcmp(a[i],s)==) num=i;
for(int i=;i<=;i++)
if(strcmp(b[i],s)==) num=*i;
printf("%d\n",num);
}
else
{
int num=;
char op[]; int sz=;
for(int i=;i<p;i++) op[sz++]=s[i]; op[sz]=;
for(int i=;i<=;i++)
if(strcmp(b[i],op)==) num=*i;
sz=;
for(int i=p+;s[i];i++) op[sz++]=s[i]; op[sz]=;
for(int i=;i<=;i++)
if(strcmp(a[i],op)==) num+=i;
printf("%d\n",num);
}
}
}
return ;
}

最新文章

  1. react native 键盘遮挡按钮点击事件
  2. Fedora17安装MySQL及配置
  3. 【转】java项目转web项目
  4. mysql怎么导入大文件的sql文件
  5. [Mysql] mysql临时表corrupt
  6. NOIP 2015 信息传递
  7. 怎样设置一个DIV在所有层的最上层,最上层DIV
  8. Flume practices and sqoop hive 2 oracle
  9. iOS关于rar解压第三方库Unrar4iOS使用总结
  10. noip2009提高组题解
  11. 【转】shell脚本调试(bash trap support bashdb )
  12. java集合类——Stack类
  13. Linux 防火墙设置,禁止某个ip访问
  14. RESTFul中的那些事(1)---在RESTFul中,HTTP Put和Patch操作的差别?
  15. C++_基础_C与C++的区别
  16. WEB ICON 的探讨
  17. Mysql经常使用命令
  18. Libevent源码分析—event_init()
  19. hdu 5122(2014北京—dp)
  20. Android设置竖屏

热门文章

  1. alertview 添加图片
  2. js 总结累计大全
  3. ubuntu14.04 安装 tensorflow
  4. sd卡文件操作
  5. OutputDebugString输出调试信息到debugtrack
  6. HDU2673:shǎ崽 OrOrOrOrz
  7. Uploadify自定义提示信息
  8. iperf linux版本移植到android (使用工具链方式不是使用Android.mk)
  9. AVFoundation(一)---AVAudioPlayer
  10. ios屏幕