1 solutions

  • 0
    @ 2026-11-15 12:19:34

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    int digs[15];
    int main()
    {
        int n, len = 0;
        cin >> n;
        while(n != 0) {
            digs[len] = n % 10;
            n /= 10;
            len++;
        }
        for(int i = 0; i * 2 <= len; i++) {
            if(digs[i] != digs[len - i - 1]) {
                cout << "no";
                return 0;
            }
        }
        cout << "yes";
        return 0;
    }
    
    
    • 1

    Information

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