Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <stdio.h>
- #include <windows.h>
- #include<time.h>
- using namespace std;
- int main()
- {
- string userName;
- string userPassword;
- int loginAttempt = 0;
- SetConsoleTitle(L"SHOCKWAVE");
- while (loginAttempt < 3)
- {
- system("cls");
- printf("Release Date: %s @ %s\n", __DATE__, __TIME__);
- cout << "Please enter your user name: ";
- cin >> userName;
- cout << "Please enter your user password: ";
- cin >> userPassword;
- if (userName == "Miki" && userPassword == "1337")
- {
- system("cls");
- cout << "Welcome Miki!\n";
- break;
- }
- else if (userName == "Fanta" && userPassword == "1337")
- {
- system("cls");
- cout << "Welcome Fanta!\n";
- break;
- }
- else if (userName == "SMOVE" && userPassword == "1337")
- {
- system("cls");
- cout << "Welcome SMOVE!\n";
- break;
- }
- else
- {
- cout << "Invalid login attempt. Please try again.\n" << '\n';
- loginAttempt++;
- }
- }
- if (loginAttempt == 3)
- {
- system("cls");
- cout << "Too many login attempts! The program will now terminate." << std::endl;
- system("pause");
- return 0;
- }
- cout << "Thank you for logging in.\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement