Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <conio.h>
- using namespace std;
- int main()
- {
- // 1 2
- const string Usernames[] = {"rdogg", "chris"};
- // 1 2
- const string Passwords[] = {"toxicwaste", "fagget" };
- bool MyLoop = true;
- while(MyLoop)
- {
- int Userinput;
- string Passinput;
- cout << "Please enter your username: ";
- cin >> Userinput;
- cout << endl;
- cout << "Please enter your password: ";
- cin >> Passinput;
- cout << endl;
- switch(Userinput)
- {
- case 1:
- if (Passinput == Passwords[1])
- {
- cout << "Welcome Rdogg";
- MyLoop = false;
- }
- else
- break;
- break;
- case 2:
- if (Passinput == Passwords[2])
- {
- cout << "Welcome Chris";
- MyLoop = false;
- }
- else
- break;
- break;
- default:
- cout << "Incorrect Username or Password please try again";
- cin.get();
- }
- system("CLS");
- }
- cin.get();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement