Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string.h>
- using namespace std;
- ifstream f("date.in");
- int k;
- class PALINDROM
- {
- public:
- char cuv[20], aux[20];
- void prelucrare(int &);
- };
- void PALINDROM :: prelucrare(int &k)
- {
- k = 0;
- while ( f >> cuv )
- {
- strcpy(aux, cuv);
- strrev(aux);
- if(strcmp(aux, cuv) == 0)
- k ++;
- }
- }
- int main()
- {
- PALINDROM obj;
- obj.prelucrare(k);
- cout << k;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement