CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
The original poster asked for a program that would take a string as input, and perform functions for specific words.
For example, let's say I want it to output "Lol!" for each "lol" in the input, and "Hello!" for each "hello".
*/
#include <iostream>
#include <vector>
using namespace std;
string toLower(string str) {
for(int i=0; i<str.size(); i++) {
str[i] = tolower(str[i]);
}
return str;
}
int main() {
//Get input from the user.
string input;
getline(cin, input);
string current; //The current string to be added to the vector.
vector<string> vect;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run