Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string username, password;
- cout << "Enter your username: ";
- getline(cin, username, '\n');
- cout << "Enter your password: ";
- getline(cin, password, '\n');
- if (username == "cat" && password == "fish" || username == "dog" && password == "bone") {
- cout << "Access allowed" << endl;
- }
- else {
- cout << "Denied access, One or both your username and password are wrong!" << endl;
- return 0;
- }
- cout << "Hello " << username << "!\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement