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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:30, ashleypere99
Jane’s team is using the v-shaped model for their project. during the high-level design phase of the project, testers perform integration testing. what is the purpose of an integration test plan in the v-model of development? a. checks if the team has gathered all the requirements b. checks how the product interacts with external systems c. checks the flow of data in internal modules d. checks how the product works from the client side
Answers: 1
image
Computers and Technology, 22.06.2019 17:50, ImBADatmath8743
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
image
Computers and Technology, 23.06.2019 22:20, tagerryawilson6
If i uninstall nba 2k 19 from my ps4 will my career be gone forever?
Answers: 2
image
Computers and Technology, 23.06.2019 22:20, Izzyfizzy
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
You know the right answer?
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex:...

Questions in other subjects:

Konu
Social Studies, 20.11.2020 22:10
Konu
Mathematics, 20.11.2020 22:10