只有60分,QAQ
代码如下,求查错,谢谢
#include <iostream>
using namespace std;
bool is_huiwenshu (int n)
{
int x=n, num=0;
while (x!=0)
{
num=num*10+x%10;
x/=10;
}
if (num==n) return true;
else return false;
}
int main()
{
int N, P;
cin>>N;
for (P=N+1; ;P++)
{
if (is_huiwenshu(P))
{
cout<<P<<endl;
break;
}
}
return 0;
}