#include #include #define BUFF_SIZE 10 #define REG_PAL 1 #define MIRR_STR 2 char * readline() { char *line = NULL; int i = 0; int length = 0; char c = 0; line = new char [BUFF_SIZE]; while(!feof(stdin)){ c = fgetc(stdin); if(c == '\n') break; if(i == length-1){ char *tmp = new char[length+BUFF_SIZE]; length += BUFF_SIZE; memcpy(tmp, line, length); line = tmp; } line[i] = c; i++; }; //printf("%s\n", line); //printf("%c\n", line[i-1]); if(feof(stdin)) line[i-1] = 0; else line[i] = 0; //*len = strlen(line); //printf("! %s\n", line); return line; } bool test_palindrome(char *line) { unsigned int i=0; int line_len = strlen(line); for(i=0;i