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, 22.06.2019 15:00
Who is the first president to use social media as part of his campaign strategy
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
You know the right answer?
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex:...
Questions
question
Mathematics, 08.10.2019 21:20
question
Mathematics, 08.10.2019 21:20
question
Biology, 08.10.2019 21:30