팰린드롬
~cpp #include <iostream> #include <string.h> using namespace std; int main() { int i,n; char buf[64]; char buf_[64]; cout<<"문자를 입력하세요."; cin>>buf; int length = strlen(buf); for (i=0;i<length;i++) buf_[i] = buf[length-i-1]; buf_[length] = '\0'; for (i=0;i<length;i++) { if (buf[i] != buf_[i]){ cout<<"false"; cout<<"\n"; return 0; } } cout<<"true"; cout<<"\n"; return 0; }