며칠전에 똑같이 글올렸었는데 이번에 다른방식으로 해봤습니다.

strcmp 사용해서 회문 작성하라는 과제였는데 


#include <stdio.h>

#include <string.h>

main()

{

char a[80], b[80];

int i;

printf("철자를 입력하시오");

gets(a);


strcpy(b,a);

for(i=strlen(b)-1; i>=0; i--)  //0번부터 첨자가 있기때문에

putchar(b[i]);


if(strcmp(a,b)==0)

printf("\n회문입니다.\n");

else

printf("\n회문이 아닙니다.\n");


}


이렇게쓰면 계속 회문입니다만 출력됩니다ㅠㅠ 뭘고쳐야하는거죠