U E D R , A S I H C RSS

데블스캠프2006/화요일/pointer/문제4/이장길

~cpp

#include <iostream>
using namespace std;

void main()
{

	char buf[64] = {0, };
	char reverse[64];
	int i;
	

	cin >> buf;

	int length = strlen(buf);
	
	for(i=0; i<length ; i++){
		reverse[(length-1)-i] = buf[i];
	}
	reverse[length] = '\0';

	cout <<reverse << endl;

	for(i=0; i<length; i++){

		if(reverse[i] == buf[i]){
		}

		else{
			cout << "false" << endl;
			return ;
		}
	}
	cout << " true " <<endl;
}

	
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-05-27 07:09:18
Processing time 0.0831 sec