Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- /*
- Author: Kanan Asgarli
- https://www.e-olymp.com/az/problems/19
- */
- using namespace std;
- string num;
- int ans, l;
- int main() {
- cin>>num;
- l = num.length();
- for(int i = 0; i < l/2; i++){
- if(num[i] == num[l-1-i])
- ans++;
- }
- if(l%2 == 1)
- ans++;
- cout<<ans<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment