Palindrome (char[]ch) { int I,J;/* indices courants */ int p;/* indicateur logique: vrai si CH est un palindrome */
/* Contrôler si CH est un palindrome */
p=1; for(I=0,J=strlen(ch); p && I<J ; I++,J--) if(CH[I]!= CH[J])
p=0; /* Affichage du résultat */ if(p) printf("La chaîne \\"%s\\" est un palindrome.\\n", CH); else printf("La chaîne \\"%s\\" n'est pas un palindrome.\\n", CH); return0; }
Void main() {
Creer(fp);
While (fgets(s,100,fp) {n=1; for(i=1;fgetc(s); i++); {
If (s[i]==” ”)
Ch=strncpy(s,ch,i-n);
n=i;
Palindrome(ch) } }