팰린드롬
~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;
}
Retrieved from http://wiki.zeropage.org/wiki.php/데블스캠프2006/화요일/pointer/문제4/성우용
last modified 2021-02-07 05:29:07