get 和 base函数 进制转换
char get(int x)
{
if (x <= 9) return x + '0';
return x - 10 + 'A';
}
string base(int x, int b)
{
string res;
while (x)
{
res += get(x % b);
x /= b;
}
reverse(res.begin(), res.end());
return res;
}
判断字符串或者数组 / vector 是否回文
for (int i = 0, j = a.size() - 1; i < j; i ++ , j -- )
if (a[i] != a[j])
return false;
return true;