2. 密码为“happy”或输入次数大于等于3次。其中密码用变量password表示,输入次数用变量count表示。

来源:百度知道 编辑:UC知道 时间:2024/06/01 02:33:27
2. 密码为“happy”或输入次数大于等于3次。其中密码用变量password表示,输入次数用变量count表示。
用VB布尔表达式表示

static iCount as integer
if password<>"happy" then
icount=icount+1
if icount>=3 then
msgbox "密码错误!你已超过重试次数"
end
else
msgbox "密码错误!请重试"
end if
else
msgbox "密码正确"
end if