Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <ctime>
- #include <iomanip>
- using namespace std;
- int counter = 60;
- int zeit(int counter)
- {
- Sleep(1000);
- while (counter >= 0)
- {
- cout << "\rTimne Renaming" << setw(5) << counter;
- Sleep(1000);
- counter--;
- }
- return 0;
- }
- int checkPassword()
- {
- int id ;
- int pass ;
- int id2 = 123;
- int pw = 321;
- ;
- cout << "geben sie die ID an: ";
- cin >> id;
- cout << "geben sie das passwort ein: ";
- cin >> pass;
- int i;
- //3 Versuche
- i = 3;
- while (i >= 1) // Schleifenbedingung
- {
- cout << zeit(60);
- cout << "Sie haben noch " << i << " Versuche" <<endl; // Aktion
- i--;
- if (id == id2 && pass == pw)
- {
- cout << "erfolgreich";
- }
- else if (id != id2 || pass != pw)
- {
- cout << "Geben sie die ID an: ";
- cin >> id;
- cout << "Geben sie das Passwort ein: ";
- cin >> pass;
- }
- if (i == 0)
- {
- cout << "Ihr Konto wurde Gesperrt";
- }
- }
- return id2, pw;
- }
- int main(int argc, const char* argv[])
- {
- checkPassword();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement