/*
author:zjlooojoe
date:2018/7/24
*/
class Solution {
public:
bool isPalindrome(int x)
{
int k=x;
int res = 0;
if (x < 0)return false;
if ((x>0)&&(x<10)) return true;
if (x/10 > 0)
{
int n = 1;
vector<int> j;
for (int i=0; i<n; i++)
{
j.push_back(k % 10);
k /= 10;
for (int i = 0; i<n; i++)
{
j.at(i) = j.at(i) * 10;
}
if (k/10!=0)n++;
}
for (int i = 0; i<n; i++)
{
res += j.at(i);
}
res += k;
}
if(res == x)return 1;
else return 0;
};
};
如果出现了
error: stray ‘\357’ in program
error: stray ‘\357’ in program
error: stray ‘\274’ in program
error: stray ‘\233’ in program
此类错误的原因,在编辑器中使用的utf-8的格式保存源代码中出现了中文的标点符号