Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <string>
- using namespace std;
- string repeatPassword() {
- string checkPassword;
- std::cout << "Repeat password: ";
- getline(cin, checkPassword);
- system("CLS");
- return checkPassword;
- }
- string registerAccount() {
- string password;
- string username;
- std::cout << "Register" << std::endl;
- std::cout << "Username: ";
- getline(cin, username);
- system("CLS");
- std::cout << "Password: ";
- getline(cin, password);
- system("CLS");
- return password;
- }
- string checkIfSame() {
- string password1 = registerAccount();
- string password2 = repeatPassword();
- if (password1 == password2) {
- std::cout << "Account created";
- Sleep(1500);
- system("CLS");
- std::cout << "Going to login";
- Sleep(2000);
- system("CLS");
- }
- else {
- std::cout << "Login failed - Passwords are the same!";
- Sleep(3000);
- system("CLS");
- checkIfSame();
- }
- }
- void login() {
- checkIfSame();
- }
- int main() {
- login();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement