Advertisement
Guest User

Untitled

a guest
Sep 1st, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  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 passwordprompt[] = "Password: ";
  25. char entered[10];
  26. char *Prompt = passwordprompt;
  27. char *EnteredPassword = entered;
  28. cout << endl << Prompt;
  29. cin >> entered;
  30.  
  31. while(Attempts != 3) {
  32. if(strget(EnteredPassword)) {
  33. cout << "Welcome to the CIA...\n\n";
  34. } else {
  35. cout << endl << "Attempt: " << Attempts << " " << Prompt;
  36. cin >> entered;
  37. }
  38. Attempts++;
  39. }
  40. cin.get();
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement