Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3. #include <ctime>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7. int counter = 60;
  8.  
  9. int zeit(int counter)
  10. {
  11.  
  12. Sleep(1000);
  13. while (counter >= 0)
  14. {
  15. cout << "\rTimne Renaming" << setw(5) << counter;
  16. Sleep(1000);
  17.  
  18.  
  19. counter--;
  20. }
  21. return 0;
  22. }
  23.  
  24.  
  25. int checkPassword()
  26. {
  27.  
  28.  
  29.  
  30. int id ;
  31. int pass ;
  32. int id2 = 123;
  33. int pw = 321;
  34.  
  35. ;
  36. cout << "geben sie die ID an: ";
  37. cin >> id;
  38.  
  39. cout << "geben sie das passwort ein: ";
  40. cin >> pass;
  41.  
  42.  
  43. int i;
  44. //3 Versuche
  45. i = 3;
  46.  
  47. while (i >= 1) // Schleifenbedingung
  48. {
  49. cout << zeit(60);
  50. cout << "Sie haben noch " << i << " Versuche" <<endl; // Aktion
  51. i--;
  52.  
  53. if (id == id2 && pass == pw)
  54. {
  55. cout << "erfolgreich";
  56. }
  57. else if (id != id2 || pass != pw)
  58. {
  59. cout << "Geben sie die ID an: ";
  60. cin >> id;
  61. cout << "Geben sie das Passwort ein: ";
  62. cin >> pass;
  63. }
  64. if (i == 0)
  65. {
  66. cout << "Ihr Konto wurde Gesperrt";
  67.  
  68. }
  69.  
  70. }
  71.  
  72.  
  73. return id2, pw;
  74. }
  75.  
  76.  
  77.  
  78.  
  79. int main(int argc, const char* argv[])
  80. {
  81. checkPassword();
  82.  
  83.  
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement