0
int main(){
char texto[1000];
do{
scanf("%[^\n]", texto);
if(!fakeEquals(texto)){
if(palindromo(texto)){
printf("SIM\n");
}else{
printf("NAO\n");
}
}
}while(!fakeEquals(texto));
return 0;
It is a program that returns if a String is palindrome or not, when it was used scan("%s", text); it was working, but since I need to read spaces too, I changed to scanf("%[ n], text); only when I type any word it is returning YES or NOT infinitely...
Thank you! That’s right :)
– Victor Harry
Great, if you solved the problem vote for the answer, it’s important to vote when you solve our problem vote
– Fábio Morais
@Victorharry If this answer solved your problem and there is no doubt left, mark it as correct/accepted by clicking on the " " that is next to it, which also marks your question as solved. If you still have any questions or would like further clarification, feel free to comment.
– Victor Stafusa