/* 给定一个字符换str(只包含字符'1'-'9'),判断这个字符串是不是镜像回文字符串
如一个字符串str与它的倒置字符串reverseStr的每一位都是镜像对应,
那么这个字符串就是镜像回文字符串
对应关系:
1 <==> 1
2 <==> 5
3 <==> 8
4 <==> 7
6 <==> 9
*/
#include <iostream>
#include <vector>
#include <string>
using namespace std;
bool isMirror(string& str) {
int len = str.length() - 1;
int index = 0;
while (index < len) {
switch (str.at(index))
{
case '1':
if (str.at(len
判断镜像回文字符串
最新推荐文章于 2021-12-12 20:18:35 发布