1 solutions

  • 0
    @ 2025-11-5 19:10:10

    C :

    #include<stdio.h>
    
    int main()
    {
    	printf("95959");
    		
    	return 0;
    }
    

    C++ :

    #include<iostream>
    using namespace std;
    bool ishw(int n)
    {
    	int a[10]={0};
    	while (n)
    	{
    		a[++a[0]]=n%10;
    		n/=10;
    	}
    	for (int i=1,j=a[0]; i<j; i++,j--)
    		if (a[i]!=a[j]) return false;
    	return true;
    }
    int main()
    {
    	int n=95859;
    	while (++n)
    		if (ishw(n)) break;
    	cout<<n<<endl;
    	return 0;
    } 
    
    • 1

    Information

    ID
    19206
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    (None)
    # Submissions
    0
    Accepted
    0
    Uploaded By