코드 ¶
~cpp
#include <iostream>
using namespace std;
#define TRUE 1
#define FALSE 0
void main()
{
char buffur[255];
cin >> buffur;
int strSize = strlen(buffur);
int nowCheck = strSize - 1;
bool isSame = TRUE;
for (register unsigned int i = 0; i < strSize / 2; ++i)
{
//// 한글인가?
if (0 > buffur[i])
{
if (buffur[i] != buffur[nowCheck - 1] || buffur[i + 1] != buffur[nowCheck] )
{
isSame = FALSE;
break;
}
++i;
nowCheck -= 2;
}
else
{
if (buffur[i] != buffur[nowCheck])
{
isSame = FALSE;
break;
}
--nowCheck;
}
}
if (isSame)
cout << "true" << endl;
else
cout << "false" << endl;
}