Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <string.h>
- using namespace std;
- int main();
- bool strget(char password[])
- {
- char Local[10] = "AP4ssW0rD";
- if(password == Local) {
- return true;
- } else {
- return false;
- }
- }
- int main()
- {
- int Attempts = 1;
- char passwordprompt[] = "Password: ";
- char entered[10];
- char *Prompt = passwordprompt;
- char *EnteredPassword = entered;
- cout << endl << Prompt;
- cin >> entered;
- while(Attempts != 3) {
- if(strget(EnteredPassword)) {
- cout << "Welcome to the CIA...\n\n";
- } else {
- cout << endl << "Attempt: " << Attempts << " " << Prompt;
- cin >> entered;
- }
- Attempts++;
- }
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement