Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream f("plimbare.in");
- ofstream g("plimbare.out");
- int n,x;
- bool palindrom(int x)
- {
- int z=0,y;
- y=x;
- while(x!=0)
- {
- z=z*10+x%10;
- x=x/10;
- }
- if(z==y)
- return true;
- else
- return false;
- }
- int main()
- {
- f>>n;
- int nr=0;
- while(n--)
- {
- f>>x;
- if(palindrom(x))
- ++nr;
- }
- g<<nr;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement