Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void UserpassFunc()
- {
- string username;
- int password;
- bool success = 0;
- while (success == 0)
- {
- cout << "Please enter your username: ";
- cin >> username;
- cout << "Please enter your password: ";
- cin >> password;
- if (username == "delcari" && password == 123 || username == "Azex" && password == 456)
- {
- cout << "Access Granted";
- success = 1;
- }
- else
- {
- cout << "Access Denied\n";
- success = 0;
- }
- }
- }
- int main()
- {
- UserpassFunc();
- cin.ignore();
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement