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 entered[10];
- cout << endl << "Password: ";
- cin >> entered;
- while(Attempts != 3) {
- if(strget(*entered)) {
- cout << "Welcome to the CIA...\n\n";
- break;
- } else {
- cout << "Failure" << endl;
- cout << endl << "Attempts: " << Attempts << " out of 3" << endl << "Password: ";
- cin >> entered;
- }
- Attempts++;
- }
- cin.ignore();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement