Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PobieranieHasla.cpp
- // {P}
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include "conio.h"
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- string Haslo;
- char d = '*';
- char temp;
- int dlugosc = 0;
- for(;;)
- {
- cout << "Podaj Haslo\n:";
- for(int i=0; i<dlugosc; ++i) cout << "*";
- temp = _getch();
- system("CLS");
- if(temp == 13) break;
- if(temp == 8 && dlugosc>0)
- {
- --dlugosc;
- Haslo.resize(Haslo.length()-1);
- continue;
- }
- else if(temp<33 || temp>122)continue;
- Haslo.push_back(temp);
- ++dlugosc;
- }
- cout << "Pobrane haslo to : " << Haslo << endl;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement