n 的阶乘:
dim n as single,i as single,s as single
n=inputbox(" 请输入整数n: ")
s=1
for i=1 to n
s=s*i
next i
print "s=";s
计算下面n(n属于N)个数的和: 2,3/2,4/3,5/4,....,n+1/n。
dim n as integer,i as integer ,s as single
s=0
n=inputbox("Please input number:")
for i=1 to n
s=s+(i+1)/i
next i
print "s=";s
read n
s=1
for i from 1 to n
s=s*i
end for
print s
下一道
read n
s=0
for i=1 to n
s=s+(n+1)/n
end for
print s
这个是早期的basic版本
现在高中竟然教这个,真他粮的