level 1
这段代码输入10个人数,只弹一次分数对话框,我想输入几个人就弹几次分数的,怎么做的.能告诉我吗,我是新手
dim i,ti=inputbox("请输入班级人数") t=inputbox ("请输入分数")if t>=0 and t<60 then msgbox "不及格"elseif t>=60 and t<80 then msgbox "及格"elseif t>=80 and t<90 then msgbox "良好"elseif t>=90 and t<=100 then msgbox "优秀"else msgbox "成绩有误"end if
2007年04月01日 12点04分
1
level 0
小弟比较菜呢。目前只有这点办法了。给你代码吧。直接存为vbs格式的文件就可以用了。不能输入其它字符或者空格。否则出错。(小弟实在没办法了)dim i,t,n,jg,bjg,lh,yxjg=0bjg=0lh=0yx=0i=inputbox("请输入班级人数")while i = ""msgbox "您没有输入班级人数,请输入!",vbinformation,"错误提示"i=inputbox("请输入班级人数")Wendfor n=1 to it=inputbox("请输入第 " &n& " 名学生成绩")while t = ""msgbox "您没有输入学生成绩,请输入!",vbinformation,"错误提示"t=inputbox("请输入第 " &n& " 名学生成绩")wendif t>=0 and t<60 then msgbox "不及格",vbinformation,"成绩提示" bjg=bjg+1elseif t>=60 and t<80 then msgbox "及格",vbinformation,"成绩提示" jg=jg+1elseif t>=80 and t<90 then msgbox "良好",vbinformation,"成绩提示" lh=lh+1elseif t>=90 and t<=100 then msgbox "优秀",vbinformation,"成绩提示" yx=yx+1else msgbox "成绩有误",vbinformation,"错误提示"end ifif n > i then exit fornextmsgbox "您的班里共有 " & i & " 名学生。" & vbcrlf & vbcrlf & "不及格:" & bjg & vbcrlf & "及 格:" & jg & vbcrlf & "良 好:" & lh & vbcrlf & "优 秀:" & yx,vbinformation,"成绩总览" QQ:78731317
2007年04月01日 17点04分
2
level 1
非常感谢上面这位朋友帮我解决了问题,虽然过程写的有点复杂,但容易看懂,我又了解了不少,十分感谢
2007年04月02日 10点04分
3
level 1
on error resume nextdim i,ji=inputbox("请输入班级人数") for c=1 to idim tt=inputbox ("请输入第" & c & "个学生的成绩:")if t>=0 and t<60 then msgbox "不及格" elseif t>=60 and t<80 then msgbox "及格" elseif t>=80 and t<90 then msgbox "良好" elseif t>=90 and t<=100 then msgbox "优秀" else msgbox "成绩有误" end if next简单一点点
2007年04月21日 01点04分
4
level 1
这样就可以在无输入的情况下退出!
on error resume next dim i,j i=inputbox("请输入班级人数") for c=1 to i dim t t=inputbox ("请输入第" & c & "个学生的成绩:") if t<>"" then '<------------------------------加入这一句就可以了 if t>=0 and t<60 then msgbox "不及格" elseif t>=60 and t<80 then msgbox "及格" elseif t>=80 and t<90 then msgbox "良好" elseif t>=90 and t<=100 then msgbox "优秀" else msgbox "成绩有误" end if end if '<---------------------------------------结束 next
2007年05月18日 02点05分
8