求助,please?!
查看原帖
求助,please?!
583238
StarTAT楼主2022/5/13 10:19

70tps 3个wa

#include<bits/stdc++.h>
using namespace std;
long long n,m;
bool ch(long long x){
    if(x<10){
        return true;
    }
    long long y=0,z=x;
    while(x>0){
        y=y*10+x%10;
        x/=10;
    }
    if(z==y){
        return true;
    }
    else return false;
}
int main() {
    cin>>n;
    for(long long i=n+1;;i=i+1){
        if(ch(i)==true){
                cout<<i<<endl;
                return 0;
            }
    }
    return 0;
}
2022/5/13 10:19
加载中...