#include"stdafx.h" #include"stdio.h" #include"windows.h" #include"conio.h" int i = 0; char ch, pass[20],check[20]; void main(){ ch = _getch(); while (ch != 13) { if (ch == 8) { i--; printf("\b "); printf("\b"); } else if ((ch <= 'Z'&&ch >= 'A') || (ch <= 'z'&&ch >= 'a') || (ch <= '9'&&ch >= '0')) { printf("%c", ch); pass[i] = ch; check[i] = ch; i++; } ch = _getch(); } if (!strcmp(pass, check)) { printf("true"); } }