Using the knowledge of computational language in C++ it is possible to describe given string userstr on one line and integers idx1 and idx2 on a second line, change the character at index idx1 of userstr to the character at index idx2.
#include <iostream>
#include <string>
using namespace std;
int main(){
string inputStr;
int idx1;
int idx2;
getline(cin, inputStr); // Input string by user
cin >> idx1; // Input index 1 to to add a new character from index 2
cin >> idx2; // Input index 2 to repalce the character in index 1
char ch = inputStr[idx2]; // get character of index 2
inputStr[idx1] = ch; // repalce character of index 2 in index 1
// display new string
cout << inputStr << endl;
return 0;
}
See more about C++ at brainly.com/question/18502436
#SPJ1