Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- string loginuser;
- string loginpass;
- string getuser;
- string getpass;
- cout << "Register.\n\nEnter desired username: " << endl;
- cin >> getuser;
- loginuser = getuser;
- cout << "Enter desired password: " << endl;
- cin >> getpass;
- loginpass = getpass;
- system ("CLS");
- cout << "Enter your username: " << endl;
- cin >> loginuser;
- if (loginuser == getuser) {
- goto pass;
- }
- pass:
- cout << "Enter your password: " << endl;
- cin >> loginpass;
- if (loginpass == getpass) {
- cout << "You are now logged in." << endl;
- }
- else {
- cout << "You entered the wrong password. Go back." << endl;
- goto pass;
- }
- }
Add Comment
Please, Sign In to add comment