Advertisement
Guest User

C++ Basic Login

a guest
Jul 18th, 2016
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string userName;
  9. string passWord;
  10.  
  11. cout << "Please Login!" << endl;
  12. cout << "Username: "; cin >> userName;
  13. cout << "Password: "; cin >> passWord;
  14.  
  15. if(userName == "Admin" && passWord == "AdminPass")
  16. {
  17. cout << "Welcome: " << userName;
  18. cin.get();
  19. }
  20. else
  21. {
  22. cout << "Username and/or password is incorrect!";
  23. }
  24.  
  25. cin.get();
  26. cin.get();
  27. cin.get();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement