2 solutions

  • 0
    @ 2024-12-17 20:28:16
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        int t=n;
        int y=0;
        while(n!=0)
        {
        	int a=n%10;
            y*=10;
            y+=a;
            n/=10;
    	}
    	if(y==t)
    	{
    		cout<<"YES";
    	}
    	else
    	{
    		cout<<"NO";
    	}
    	return 0;
    }
    
    • -5
      @ 2024-9-21 11:22:31
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n;
          cin>>n;
          int t=n;
          int y=0;
          while(n!=0)
          {
              int ge=n%10;
              y*=10;
              y+=ge;
              n/=10;
          }
          if(y==t)
          {
              cout<<"YES";
          }
          else
          {
              cout<<"NO";
          }
          return 0;
      }
      
    • 1

    Information

    ID
    50
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    277
    Accepted
    68
    Uploaded By