Answer the question
In order to leave comments, you need to log in
How to return DMU on copies of string fragments?
void func(char *str){
char *outStr = new char[256];
for(int i = 3; i < strlen(str)-3; i++){
int j = 1;
while(str[i-j] == str[i+j])
j++;
if(str[i-j] != str[i+j]){
cout << "\n";
}
if(j > 3){
for(int k = i-j+1; k < i+j; k++){
cout << str[k];
}
}
}
}
int main(){
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
char str[256];
cout << "Введите строку \n";
cin.getline(str,256);
func(str);
getchar();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question