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, 21.06.2019 20:50
What does operator overloading allow you to do?
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
question
Computers and Technology, 24.06.2019 11:40
100 pts. first person gets brainliest
Answers: 2
question
Computers and Technology, 24.06.2019 19:00
In python a floating-point number must be written using scientific notation?
Answers: 1
You know the right answer?
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex:...
Questions
Questions on the website: 13722367