#include<bits/stdc++.h>
using namespace std;
char rev[]="A 3 HIL JM O 2TUVWXY51SE Z 8 ";
char *msg[]={"is not a palindrome","is a regular palindrome","is a mirrored string","is a mirrored palindrome"} ;
char aa(char a){
if(isalpha(a)) return rev[a-'A'];//判断字符ch是否为英文字母,若为英文字母,返回非0(小写字母为2,大写字母为1)。若不是字母,返回0。
else return rev[a-''+];
}
int main(){
char s[];
while(scanf("%s",s)==){
int p=,m=;
int len=strlen(s);
for(int i=;i<(len+)/;i++){
if(s[i]!=s[len--i]) p=;//回文串判断
if(aa(s[i])!=s[len--i]) m=;//镜像串判断 镜像之后,是否和右边的一样
}
printf("%s--%s.\n",s,msg[m*+p]);
} return ;
}

如果ch是大写字母,则ch-‘A’就是它在字母表中的序号,(A的序号为0,B为1)

如果ch为数字,那么ch-‘0’就是这个数值本身,' 5 ' -  ' 0 ' =5;

最新文章

  1. php中redis的安装
  2. Windows Azure Service Bus (5) 主题(Topic) 使用VS2013开发Service Bus Topic
  3. ZOJ 1095 Humble Numbers
  4. Android窗口管理服务WindowManagerService对壁纸窗口(Wallpaper Window)的管理分析
  5. sublime实现markdown浏览器预览
  6. 【优秀的图片后期编辑工具】Luminar 3.1 for Mac
  7. 关于element-ui表格table设置header-cell-class-name样式不起作用的原因分析
  8. nginx中root和alias的区别
  9. Python从菜鸟到高手(18):类与方法的私有化
  10. 洛谷P2764 最小路径覆盖问题
  11. Delphi中封装ADO之我重学习记录
  12. Educational Codeforces Round 26-D. Round Subset
  13. 【tomcat】启动报错:Failed to initialize end point associated with ProtocolHandler [&quot;http-apr-8080&quot;] java.lang.Exception: Socket bind failed 和java.net.BindException: Address already in use: JVM_Bind错误解决
  14. svn log — 显示提交日志信息
  15. PHP CURL 抓取失败 自己调试
  16. bzoj 2406 二分+有源有汇上下界网络流可行流判定
  17. 一站式学习Wireshark(十):应用Wireshark显示过滤器分析特定数据流(下)
  18. C# - 静态类和静态构造函数
  19. Java 实现 RSA 非对称加密
  20. 9.详解引擎(InnoDB,MyISAM)的内存优化攻略?

热门文章

  1. WIN10开启FTP(完整版)
  2. OpenCV基本绘图函数
  3. PAT (Basic Level) Practice (中文)1056 组合数的和 (15 分)
  4. 教你阅读Python开源项目代码
  5. ElementUI的el-table的多选的取消选择和筛选的取消所有过滤器之ref冲突问题
  6. unicode 地址
  7. docker的个人理解
  8. 栈和队列----设计一个有getMin功能的栈
  9. 我的第一个Maven Helloworld
  10. 使用python 写一个 股票涨跌提醒功能