Advertisement
STANAANDREY

temad

Nov 26th, 2018
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;// ||
  4.  
  5.     int main () {
  6.  
  7.     int a,b,inv,i=0;
  8.  
  9.     cin>>a;
  10.     b=a;
  11.     while (b!=0)
  12.     {
  13.      inv=0;
  14.  
  15.      cin>>b;
  16.       while (a!=0)
  17.       {
  18.           inv=inv*10+a%10;
  19.           a/=10;
  20.       }
  21.       if (b==inv)
  22.       i++;
  23.      a=b;
  24.     }
  25.    cout<<i;
  26. return 0;
  27.     }//*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement