getpass
getpass(const char* prompt);
char name[1024];
memset(name, 0, sizeof(name));
printf("請輸入用戶名:");
scanf("%s", name);
char *passwd=getpass("請輸入密碼:");
if ((strcmp(name, "root") == 0) && (strcmp(passwd, "123456") == 0)) {
printf("登陸成功\n");
}else{
printf("登陸失敗\n");
}