subject

Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is:

censored

ex: if userinput is "dang, that was scary! ", then output is:

dang, that was scary!

note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.

#include

#include

using namespace std;

int main() {

string userinput;

getline(cin, userinput);

int ispresent = userinput. find("darn");

if (ispresent > 0){

cout < < "censored" < < endl; /* your solution goes here */

return 0;

}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
One subtask in the game is to roll the dice. explain why is roll the dice an abstraction.
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
If an improvement creates no significant change in a product’s performance, then it is a(n) ? a0 design improvement. (there are no answer choices)
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Which of the following tasks is an audio technician most likely to perform while working on a nature documentary? (select all that apply). eliminating potentially distracting background noise adding sound effects making sure the lighting is adequate for a particular scene changing the narration to better match the mood of the documentary
Answers: 3
You know the right answer?
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex:...
Questions
question
Mathematics, 05.12.2021 06:00
Questions on the website: 13722363