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, 23.06.2019 16:00
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
question
Computers and Technology, 24.06.2019 12:00
How can we take picture in this app
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Click on the tab on the ribbon to open the backstage view. file view insert review
Answers: 1
question
Computers and Technology, 24.06.2019 20:10
Approximately what portion of global employers tends to use social media websites to hire new employees?
Answers: 1
You know the right answer?
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex:...
Questions
question
Health, 15.01.2021 20:30
question
History, 15.01.2021 20:30
question
Chemistry, 15.01.2021 20:30
Questions on the website: 13722367