This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 1st, 2012  |  syntax: None  |  size: 0.78 KB  |  views: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. using namespace std;
  6.  
  7. int main();
  8.  
  9. bool strget(char password)
  10. {
  11.     char Local[10] = "AP4ssW0rD";
  12.  
  13.     if(password == *Local) {
  14.         return true;
  15.     } else {
  16.         return false;
  17.     }
  18. }
  19.  
  20.  
  21. int main()
  22. {
  23.     int Attempts = 1;
  24.     char entered[10];
  25.     cout << endl << "Password: ";
  26.     cin >> entered;
  27.  
  28.     while(Attempts != 3) {
  29.         if(strget(*entered)) {
  30.             cout << "Welcome to the CIA...\n\n";
  31.             break;
  32.         } else {
  33.             cout << "Failure" << endl;
  34.             cout << endl << "Attempts: " << Attempts << " out of 3" << endl << "Password: ";
  35.             cin >> entered;
  36.         }
  37.         Attempts++;
  38.     }
  39.     cin.ignore();
  40.     cin.get();
  41.     return 0;
  42. }
clone this paste RAW Paste Data