Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///14
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <cmath>
- using namespace std;
- /*
- 123321 162 32 12321 959 46654
- */
- bool sim(int a){
- a=fabs(a);
- if (a<10) return 0;
- vector <int> z1;
- while (a){
- z1.push_back(a%10);
- a/=10;
- }
- /* for (int i=0; i<z1.size(); i++)
- cout<<z1[i]<<' ';
- cout<<endl;*/
- vector <int> z2(z1.size());
- reverse_copy(z1.begin(),z1.end(),z2.begin());
- /* for (int i=0; i<z2.size(); i++)
- cout<<z2[i]<<' ';
- cout<<endl;*/
- return equal(z1.begin(),z1.end(),z2.begin());
- }
- int main()
- {
- vector <int> v;
- int x;
- while (cin>>x)
- v.push_back(x);
- cout<<"Takih chisel = "<<count_if(v.begin(),v.end(),sim);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement