Advertisement
Guest User

Untitled

a guest
Mar 5th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <conio.h>
  6.  
  7. int main(void){
  8. SetConsoleCP (1251);
  9. SetConsoleOutputCP (1251);
  10. char password[100],c;
  11. int i;
  12. i=0;
  13. while ((password[i]=getch())!='r'){
  14. if (password[i]=='b' && i!=0){
  15. printf("%s", "b b");
  16. i--;
  17. continue;
  18. }
  19. printf("%c", '*');
  20. i++;
  21. }
  22. printf("npassword is %sn", password);
  23. return 0;
  24. }
  25.  
  26. Вывод при пароле "qwe"(звездочки это еще ввод самого пароля)
  27. ***
  28.  
  29. r╗Мюad is qwe
  30.  
  31. Вывод при пароле qwerty
  32. ******
  33. ╗Мюaword is qwerty
  34.  
  35. Вывод при пароле qwertyuiop
  36. **********
  37. password is qwertyuiop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement