I solve the problem, I do not understand how to make a replacement only in the first half of the line.
Task:
In the given line in the first half of the line, all points should be replaced with the~character.
Made only a replacement:
#include <iostream> int main() { char stroka[] = "....."; std::cout << stroka << "\n"; for(int i = 0; stroka[i] != '\0'; ++i) { if(stroka[i] == '.') stroka[i] = '~'; } std::cout << stroka << "\n"; return 0; }
stroka[i] != '\0'makei < длина строки. Then divide the length by 2 and the problem is solved. - HolyBlackCat