Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cstring>
- using namespace std;
- ifstream fin("palindrom.in");
- ofstream fout("palindrom.out");
- int palindrom(char * s){
- for(int i=0, j=strlen(s)-1 ; i< j ; ++i, --j)
- if(s[i]!=s[j])
- return 0;
- return 1;
- }
- int main(){
- int n;
- char s[25];
- fin >> n ;
- for (; n ; --n){
- fin >> s;
- fout << palindrom(s) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement