比如密码是数字(字符也一样,换一下类型就好了)
int password = "123";
int inputValue;
scanf("%d",&inputValue);
if(inputValue==password)
printf("ok");
else{
scanf("%d",&inputValue);
if(inputValue==password)
printf("ok");
else{
scanf("%d",&inputValue);
if(inputValue==password)
printf("ok");
else{
printf("登陆失败");
}
}
}
温馨提示:答案为网友推荐,仅供参考