Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created April 25, 2012 16:07
Show Gist options
  • Save yesidays/2490964 to your computer and use it in GitHub Desktop.
Save yesidays/2490964 to your computer and use it in GitHub Desktop.
#C Palindromo
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i=0,lc=0,ban=0,d=0;
char cad[50];
printf("Introduce el texto: ");gets(cad);
while(cad[lc])
{
lc++;
}
d=lc/2;
lc--;
for(i=0;i<d;i++)
{
if(cad[i]==32)
i++;
if(cad[lc]==32)
lc--;
if(cad[i]!=cad[lc])
{
ban=1;break;
}
lc--;
}
if(ban==0)
printf("Es una palabra palindromo");
else
printf("No es una palabra palndromo");
getch();
}
@istepaniuk
Copy link

En español es palíndromo, con O.

@yesidays
Copy link
Author

:O gracias!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment