Computers and Technology

Given a string, an integer position, and a character, all on separate lines, find the character of the string in that position and replace it with the character read. Then, output the result. Ex: If the input is: warn -D-D - Du 0 e the output is: earn Note: Using a pre-defined string function, the solution can be just one line of code. 1 #include 2 #include 3 using namespace std; 4 5 int main() { 6 string workStr; 7 int idx; 8 char newChar; 9 19 getline(cin, workStr); 11 cin >> idx; 12 cin >> newChar; 13 14 15 16 cout << workStr << endl; 17 18 return; 19} 1 2 3

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:40, davidb1113
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
image
Computers and Technology, 23.06.2019 22:50, christingle2004
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
image
Computers and Technology, 24.06.2019 12:00, exoticbunnylover123
Which spreadsheet operation does a look function perform?
Answers: 1
image
Computers and Technology, 24.06.2019 17:30, bxbykay1
Looking at the electroscope, describe how you can cause the two leaves at the bottom to repel each other and stay that way
Answers: 3
Do you know the correct answer?
Given a string, an integer position, and a character, all on separate lines, find the character of t...

Questions in other subjects:

Konu
English, 08.12.2021 18:40
Konu
World Languages, 08.12.2021 18:40
Konu
Mathematics, 08.12.2021 18:40