Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int getPin();
- void repeatPin(int A);
- int main()
- {
- int Pin = getPin();
- repeatPin(Pin);
- system("PAUSE");
- }
- int getPin()
- {
- int Pin = 0;
- cout << "Podaj pin: ";
- cin >> Pin;
- cout << endl;
- return Pin;
- }
- void repeatPin(int A)
- {
- int B = 0;
- int i;
- for (i = 2; i >= 0; i--)
- {
- cout << "Powtorz pin: ";
- cin >> B;
- cout << endl;
- if (A != B)
- {
- cout << "Pin niepoprawny. Pozostalo prob: " << i;
- cout << endl;
- if (i == 0)
- {
- cout << "Twoje konto zostalo zablokowane." << endl;
- }
- }
- else
- {
- cout << "Pin poprawny." << endl;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement