#include <stdio.h>

#include <string.h>

main()

{

char a[80], b[80];

int i;

gets(a);

puts(a);


strcpy(b,a);

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

putchar(b[i]);

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

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

else

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

 

}


회문 검사하는 프로그램인데 아무거나 넣어도 다 회문입니다 라고 떠요ㅜㅜ
strrev라는거 사용하니까 한번에 되던데 학교에서 안배워서 못씁니다ㅠㅠㅠㅠ
strlen(b)/2해도 똑같던데
제생각에 for문부터 잘못된거같아서 4시간동안 이러고있는데 여기서 뭘 더 어떻게해야되는지 모르겠습니다 도와주세요제발ㅜㅜ