daily pastebin goal
85%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.     int a,b,rev=0,rem,n;
  9.     cin>>a;
  10.     for(int i=1;i<=a;i++)
  11.     {
  12.         cin>>n;
  13.         while(n!=0)
  14.         {
  15.             b=n;
  16.             rem=n%10;
  17.             rev=rev*10+rem;
  18.             n=n/10;
  19.  
  20.         }
  21.         if (rev == b)
  22.         {
  23.             cout<<"Case "<<i<<": Yes\n";
  24.         }
  25.         else
  26.         {
  27.             cout<<"Case "<<i<<": No\n";
  28.         }
  29.  
  30.     }
  31.  
  32.  
  33.     return 0;
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top