vf程序编写

来源:百度知道 编辑:UC知道 时间:2024/06/29 01:11:18
1、输入一百分制成绩,将其转换为等级制并输出。(90分以上为A等,80—89分为B等,70—79分为C等,60-69分为D等,60分以下为E等)
2、用循环语句编写在屏幕上显示如下图形的程序。
3、输出1—100之间能被29整除的数。
4、编写一个求N的阶乘的自定义函数。然后计算10!-8!+5!并输出结果。
此题目利用UDF(用户自定义函数来做)

function fentodegree(fen as double) as string
dim a as string
if fen>=90 then
a="A"
elseif fen>=80 then
a="B"
elseif fen>=70 then
a="C"
elseif fen>=60 then
a="E"
else
a="F"
fentodegree=a
end function

3\
dim mystr as string
mystr="能被29整除的数有如下:"
for i=1 to 100
if i mod 29 =0 then mystr=mstr+" "+cxtr(i)
next i
msgbox(mystr)
4$$$444444444444444
function jiecheng(innumber as long) as double
dim i as long
dim a as double
a=1
for i=1 to innumber
a=a*i
next i
jiecheng=a
end function
msgbox(jiecheng(10)-jiecheng(8)+jiecheng(5))
我的分啊!!!!加加加

你去死吧,一个问题这么多题.