Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int bugs = 99;
- string input("");
- cout << "Enter 'exit' to end the awesomeness.\n\n";
- do {
- cout << bugs << " little bugs in the code" << '\n';
- cout << bugs << " little bugs in the code" << '\n';
- cout << "Take one down, patch it around." << '\n';
- if (bugs <= 5)
- --bugs;
- else
- bugs = rand() % 500 + 1;
- string extraText("");
- if (bugs <= 0)
- extraText = "Yay!";
- cout << bugs << " little bugs in the code..." << extraText << '\n';
- if (bugs > 0) {
- cout << "(Next round)";
- getline(cin, input);
- cin.clear();
- }
- } while (input != "exit" && bugs > 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement