Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- const int CAPASITY = 2;
- string username[CAPASITY];
- string password[CAPASITY];
- bool userCheck;
- cout << "Please create a username: ";
- cin >> username[0];
- cout << "Please create a password: ";
- cin >> password[0];
- do{
- cout << "Please enter your username : ";
- cin >> username[1];
- cout << "Please enter your password : ";
- cin >> password[1];
- if (username[0] == username[1])
- {
- if (password[0] == password[1])
- {
- cout << "Username and password is correct!" << endl;
- cout << "Access..." << endl;
- userCheck = true;
- }
- }
- else if (username[0] != username[1] || password[0] != password[1])
- {
- userCheck = false;
- cout << "Username and password is wrong." << endl;
- cout << "Access is denied... Try again!!" << endl;
- }
- } while (!userCheck );
- cout << "hello world" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement