用VB编程问题

来源:百度知道 编辑:UC知道 时间:2024/05/01 18:36:25
3。征兵的条件是:性别(sex)为男性(malw),年龄(age)在18到20岁之间,身高(size)在1。65以上;或者性别为女性(female),年龄在16到18岁之间,身高在1。60以上。

4。应聘的条件是:已经毕业(gtaduated),年龄(age)在26岁以上,工作年龄(workingage)在5年以上。

5。x是小于100的非负数

用VB写逻辑表达式就行

3
if sex="malw" then
if age>=18 and age<=20 then
if size>1.65 then
print "符合条件!!!"
end if
end if
else
if sex="female" and age>=16 and age<=18 and size>1.60 then
print "符合条件!!!"
end if
end if

其他的也一样的了

if sex="malw" then
if age>=18 and age<=20 then
if size>1.65 then
print "符合条件!!!"
end if
end if
else
if sex="female" and age>=16 and age<=18 and size>1.60 then
print "符合条件!!!"
end if
end if