Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n;
- int nrasociat(int x)
- {
- int y = 0;
- while(x > 0)
- {
- if((x % 10) %2 == 0)
- y = y * 10 + x % 10;
- x /= 10;
- }
- return y;
- }
- int palindrom(int x)
- {
- int y, z = 0 ;
- y = x;
- while(y > 0)
- {
- z = z * 10 + y % 10;
- y/=10;
- }
- if(z == x) return 1;
- else return 0;
- }
- void Read()
- {
- int i,x,cnt = 0;
- cin >> n;
- for(i = 1 ; i <= n ; i ++)
- {
- cin >> x;
- if(palindrom(nrasociat(x)) == 1) cnt ++;
- }
- cout << cnt;
- }
- int main()
- {
- Read();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement