Last active
September 10, 2018 21:38
-
-
Save carmel4a/e23d71c027f71f5bd99b6d226c7221fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
int proba = 0; | |
const int max_prob = 3; | |
std::string login; | |
std::string haslo; | |
while( true ) | |
{ | |
std::cout << "Podaj login: "; | |
std::cin >> login; | |
std::cout << "Podaj haslo: "; | |
std::cin >> haslo; | |
if( login == "login" | |
&& haslo == "haslo" ) | |
{ | |
std::cout << "Prawidlowe dane" << std::endl; | |
break; | |
} else if( proba < max_prob ) | |
{ | |
std::cout << "Dane nieprawidlowe "<< std::endl; | |
std::cout << "Pozotalo szans "<< max_prob - ++proba << std::endl; | |
} else | |
{ | |
std::cout << "Konto zablokowane " << proba << std::endl; | |
break; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment