Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9.     string username = "jeremy";
  10.     string userpass = "badass";
  11.     string user = "na";
  12.     string pass = "na";
  13.     bool loggedin = 0;
  14.    
  15.     cout << "Please enter your UserName: ";
  16.     cin >> user;
  17.     cout << "Please enter your password: ";
  18.     cin >> pass;
  19.     if (userpass == pass && username == user) {
  20.         bool loggedin = 1;
  21.     }
  22.     else    {
  23.         bool loggedin = 0;
  24.     }
  25.     if (loggedin == 1) {
  26.         cout << "You have successfully Logged In!" << endl;
  27.         system("pause");
  28.         return 1;
  29.     }
  30.     else {
  31.         cout << "Wrong Password or UserName" << endl;
  32.         system("pause");
  33.         return 0;  
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement