#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define MAX_MSG_LEN 100
/* Declaration */
void palindrome(char *msg);
/* Implementation */
void palindrome(char *msg) {
memset(msg
, '\0', MAX_MSG_LEN
); char *t = msg;
while(1){
if(*msg == ' ' || *msg == ','){
continue;
}
if(*msg == '.' || *msg == '!' || *msg == '?')
break;
msg++;
}
for(int i = 0;i < (msg - t) / 2;i++){
if(*(t + i) != *(msg - i)){
return;
}
}
return;
}
int main(void) {
char msg[MAX_MSG_LEN];
palindrome(msg);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjdHlwZS5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CgojZGVmaW5lIE1BWF9NU0dfTEVOIDEwMAoKLyogRGVjbGFyYXRpb24gKi8Kdm9pZCBwYWxpbmRyb21lKGNoYXIgKm1zZyk7CgovKiBJbXBsZW1lbnRhdGlvbiAqLwp2b2lkIHBhbGluZHJvbWUoY2hhciAqbXNnKSB7CgkKCW1lbXNldChtc2csICdcMCcsIE1BWF9NU0dfTEVOKTsKCWNoYXIgKnQgPSBtc2c7Cgl3aGlsZSgxKXsKCQkqbXNnID0gZ2V0Y2hhcigpOwoJCWlmKCptc2cgPT0gJyAnIHx8ICptc2cgPT0gJywnKXsKCQkJY29udGludWU7CgkJfQoJCWlmKCptc2cgPT0gJy4nIHx8ICptc2cgPT0gJyEnIHx8ICptc2cgPT0gJz8nKQoJCQlicmVhazsKCQkqbXNnID0gdG91cHBlcigqbXNnKTsKCQltc2crKzsKCX0KCWZvcihpbnQgaSA9IDA7aSA8IChtc2cgLSB0KSAvIDI7aSsrKXsKCQlpZigqKHQgKyBpKSAhPSAqKG1zZyAtIGkpKXsKCQlwcmludGYoIk5vdCBhIHBhbGluZHJvbWUiKTsKCQlyZXR1cm47CgkJfQoJfQoJcHJpbnRmKCJQYWxpbmRyb21lIik7CglyZXR1cm47Cn0KCmludCBtYWluKHZvaWQpIHsKCiAgICBjaGFyIG1zZ1tNQVhfTVNHX0xFTl07CgogICAgcGFsaW5kcm9tZShtc2cpOwoKICAgIHJldHVybiAwOwp9CgoKCgoKCg==