Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string username = "";
- string password = "";
- bool success = false;
- int tries = 0;
- while (!success && tries < 2)
- {
- cout << "Enter username: ";
- cin >> username;
- cout << "Enter password: ";
- cin >> password;
- if (username == "doomguy")
- {
- if (password == "killalldemons")
- {
- cout << "Welcome, Doom Slayer!" << endl;
- success = true;
- }
- else
- {
- cout << "INVALID CREDENTIALS!" << endl;
- }
- }
- if (username == "billyblaze")
- {
- if (password == "killallnazis")
- {
- cout << "Welcome, B.J.!" << endl;
- success = true;
- }
- else
- {
- cout << "INVALID CREDENTIALS!" << endl;
- }
- }
- ++tries;
- }
- cout << "Goodbye!" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement