Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdlib>
- #include <ctime>
- #include <windows.h>
- #include <cstdio>
- #include <conio.h>
- using namespace std;
- string PIN;
- string proba;
- int proba_klucza=0;
- int proba_PIN;
- string imie_nazwisko;
- int main()
- {
- while(1)
- {
- srand( time (NULL));
- int klucz=(rand()%1000) + 12;
- cout<<"Witam zarejestruj sie"<<endl;
- cout<<"Podaj imie i nazwisko: ";
- getline(cin,imie_nazwisko);
- cout<<"Za chwile zostanie wygenerowany klucz ktory masz przepisac ktory sprawdzi twoja autoryzacje"<<endl;
- Sleep(2000);
- cout<<"Twoj klucz to " <<klucz<<endl;
- cout<<"Wpisz ten klucz aby kontynowac:" ;
- cin>>proba_klucza;
- Sleep(3000);
- int PIN=(rand()%9999999)+1000000;
- if (proba_klucza==klucz)
- {
- system("cls");
- cout<<"Sprawdzilem klucz wszystko sie zgadza twoj PIN to "<<PIN<<endl;
- cout<<"Kliknij enter aby przejsc do logowania"<<endl;
- getchar();
- Sleep(2000);
- break;
- }
- else cout<<"Nie poprawny kod"<<endl; continue;
- }
- do
- {
- cout<<"Witaj "<<imie_nazwisko<<" podaj swoj PIN aby sie zalogowac: ";
- cin>>proba;
- if(proba==PIN)
- {
- cout<<"Gratulacje zalogowales sie!";
- Sleep(2000);
- break;
- }
- else
- cout<<"Przepraszam ale PIN jest niepoprawny"<<endl;
- Sleep(3000);
- continue;
- }while(PIN!=proba);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement