asgarlikanan

https://www.e-olymp.com/az/problems/19

Aug 6th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.31 KB | None | 0 0
  1. #include <iostream>
  2. /*
  3.     Author: Kanan Asgarli
  4.     https://www.e-olymp.com/az/problems/19
  5. */
  6. using namespace std;
  7. string num;
  8. int ans, l;
  9. int main() {
  10.     cin>>num;
  11.     l = num.length();
  12.     for(int i = 0; i < l/2; i++){
  13.         if(num[i] == num[l-1-i])
  14.             ans++;
  15.     }
  16.     if(l%2 == 1)
  17.         ans++;
  18.     cout<<ans<<endl;
  19.     return 0;
  20. }
Add Comment
Please, Sign In to add comment