#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int palindrome(const char *s){
int longueur=strlen(s);
int i=0;
int result = 1;
while(i<longueur/2 && result==1){
if(s[i]!= s[longueur-1-i]){
result=0;
break;
}
i++;
}
if (result==0){
return result;
} else if (result==1){
return result;
}
}
int string_size(const char *s) {
return sizeof (s) / sizeof(char);
}
int est_nombre(char ch){
if(isdigit(ch)){
return 1;
}
return 0;
}
int alphaNumeric(char ch){
if(!isalnum(ch)){
return 0;
}
return 1;
}
int palindrome2(char *s){
/*if(fgets(s, string_size(s), stdin)==NULL){
printf("Erreur \n");
return NULL;
}*/
char *s2 = malloc(sizeof(s));
//suppression espaces
for(int i=0; i<string_size(s); i++){
if(!(isspace(s[i])) && alphaNumeric(s[i])==1 && est_nombre(s[i])==0){
s2[i]=tolower(s[i]);
}
}
int pal = palindrome(s2);
if(pal==1){
printf("c'est un palindrome \n");
return 1;
}else {
printf("ce n'est pas un palindrome \n");
return 0;
}
}
/*int palindrome2(const char *s){
int longueur=0;
char s2[128]="";
int i;
int j;
int palindrome = 1;
if(fgets(s, s.size, stdin)==NULL){
printf("Erreur \n");
return NULL;
}
//conv min en maj
for(int i=0; i<s.size; i++){
if(s[i]>='A' && s[i]<='Z'){
s[i]=(s[i]-'A')+'a';
}
}
//suppression espaces
for(int i=0; i<s.size; i++){
if(s[i]!=' '){
s2[++j]=s[i];
}
s2[++j]='\0';
}
for(int i=0; i<=j ; i++){
for(int j=strlen(s2)-1; j>=i ; j--){
if(s[i]==s2[j]){
palidrome=1;
}
else{
palidrome=0
break;
break;
}
}
}
if(palindrome==1){
printf("c'est un palindrome \n");
return 1;
}else {
printf("ce n'est pas un palindrome \n");
return 0;
}
} */
int main(){
char str[20];
scanf("%s", str);
palindrome(str);
palindrome2(str);
}