Answer:
#include <string>
#include <iostream>
using namespace std;
int main() {
string userInput;
getline(cin, userInput);
// Here, an integer variable is declared to find that the user entered string consist of word darn or not
int isPresent = userInput.find("darn");
if (isPresent > 0){
cout << "Censored" << endl;
// Solution starts here
else
{
cout << userInput << endl;
}
// End of solution
return 0;
}
// End of Program
The proposed solution added an else statement to the code
This will enable the program to print the userInput if userInput doesn't contain the word darn
Answer:
The time complexity of the code is O(log₇n).
Explanation:
The i is updated by 7*i.On each iteration i is multiplied by 7.So on finding the time complexity of the code given above it will come out to be log base 7.
When we divide the input by 2 the time complexity is log base 2.
So on dividing it by 7 we get the time complexity of log base 7.
Lead Sheets, Plates, Slabs, & Foils.
Lead Shot
Answer:
Home & End are used to move the cursor to the start and end of a line