#include #include const int MAX_LENGTH = 35; typedef char string[MAX_LENGTH]; bool isPalindrome(string S, int Bgn, int End) { if ( S[Bgn] == S[End] ) return isPalindrome(S, Bgn+1, End-1); else if ( Bgn > End ) return true; else return false; } void main() { ifstream InFile("palindromes.txt"); ofstream OutFile("3.txt"); char ch; while ( InFile.peek() != EOF ) { string inStr = ""; string chkStr = ""; int inDex = 2; int chkDex = 0; while ( InFile.peek() != '\n' ) { InFile.get(ch); inStr[inDex++] = ch; if ( ( ch>='a' && ch<='z' ) || ( ch>='A' && ch<='Z' ) ) chkStr[chkDex++] = ch; } InFile.ignore(10, '\n'); char *upStr = _strupr( _strdup( chkStr ) ); if ( isPalindrome(upStr, 0, chkDex-1) ) inStr[0] = 'T'; else inStr[0] = 'F'; inStr[1] = ':'; for (int i=0; i