求VB程序设计典型例题
展开全部
修改好了测试成功,但是,基本上,偶数和会大于所有的数
private
sub
command1_click()
dim
a(10)
as
double
dim
t
as
double
randomize
for
i
=
1
to
10
a(i)
=
int(rnd
*
100
+
2)
'设十个数,给十个数随机赋值
if
a(i)
mod
2
=
0
then
t
=
t
+
a(i):
print
"偶数为";
a(i)
next
i
print
"偶数的和为";
t
for
i
=
1
to
10
if
a(i)
<
t
then
print
"小于偶数和的数";
a(i)
next
i
end
sub
private
sub
command1_click()
dim
a(10)
as
double
dim
t
as
double
randomize
for
i
=
1
to
10
a(i)
=
int(rnd
*
100
+
2)
'设十个数,给十个数随机赋值
if
a(i)
mod
2
=
0
then
t
=
t
+
a(i):
"偶数为";
a(i)
next
i
"偶数的和为";
t
for
i
=
1
to
10
if
a(i)
<
t
then
"小于偶数和的数";
a(i)
next
i
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询