1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
main(){
char * s=malloc(sizeof(*s)*256);
int i,j;
printf("****VERIFICATION DES PALINDROMES****");
printf("Veuillez saisir un mot :\n");
scanf("%s", &s);
//char *str_tolower (char *s);
printf("Vous avez saisie %s :\n");
//int t=(int)taille;
//int taille=strlen(s);
/*DEBUT DU TRAITEMENT*/
for(i=0;i<taille;i++)
{for(j=taille;j>0;j--)
{s[i] = tolower(s[i]);
if(s[i]==s[j])
printf("%s Votre mot est un palindrome.");
else{
printf("Désolé ce n'est pas un palindrome, veuillez ressayer!");
}
}}
} |
Partager