Last active
April 3, 2022 16:45
-
-
Save SmashedFrenzy16/adac96d70a3559cbfb3efb4cb97b26a0 to your computer and use it in GitHub Desktop.
MadLibs in C++.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
string noun, pluralNoun, adjective, pluralNoun2, foodItem, building; | |
cout << "Enter a noun: "; | |
getline(cin, noun); | |
cout << "Enter a plural noun: "; | |
getline(cin, pluralNoun); | |
cout << "Enter an adjective: "; | |
getline(cin, adjective); | |
cout << "Enter another plural noun: "; | |
getline(cin, pluralNoun2); | |
cout << "Enter a food item: "; | |
getline(cin, foodItem); | |
cout << "Enter a building type: "; | |
getline(cin, building); | |
cout << "\n\nThe " << noun << " went to the park " << "\n"; | |
cout << "And found some " << pluralNoun << "\n"; | |
cout << "And found " << adjective << " " << pluralNoun2 << "\n"; | |
cout << "Then ate " << foodItem << "\n"; | |
cout << "And wanted to go to his " << building << "\n"; | |
cout << "So ended up stepping in the " << pluralNoun << "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment