| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 546 人关注过本帖
标题:怎么统计啊???
只看楼主 加入收藏
hahaer789
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-10-31
收藏
 问题点数:0 回复次数:1 
怎么统计啊???

Private Sub Form_Click()
Print "姓名", "语文", "数学", "平均分"
Dim x(9) As String, s(9) As Integer, y(9) As Integer
Dim i As Integer, j As Integer, k As Integer, e As Integer
For i = 0 To 9
x(i) = i + 1
s(i) = Int(Rnd * 101)
y(i) = Int(Rnd * 101)
j = x(i)
k = s(i)
e = y(i)
Print j, k, e, (k + e) / 2
Next i
End Sub

统计出平均分低于60的人数(不包括60分)以及平均分高于60的人数(包括60分)并在屏幕上显示出来?

上面怎么统计啊,那位大大教教我,小弟非常感谢啊!

搜索更多相关主题的帖子: 统计 
2005-10-31 15:00
leon2
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:731
专家分:0
注 册:2005-3-18
收藏
得分:0 
Private Sub Form_Click()
Print "姓名", "语文", "数学", "平均分"
Dim x(9) As String, s(9) As Integer, y(9) As Integer
Dim i As Integer, j As Integer, k As Integer, e As Integer,a As Integer
Dim iPass As Integer, iUnpass As Integer '及格的和不及格的人数
For i = 0 To 9
x(i) = i + 1
s(i) = Int(Rnd * 101)
y(i) = Int(Rnd * 101)
j = x(i)
Next i

'计算及格的和不及格的
Print "及格者:"
For i = 0 To 9
k = s(i)
e = y(i)
a = (k + e) \ 2
If a >= 60 Then
Print x(i); ":"; "数学 "; k; " 语文 "; e; " 平均分 "; a
End If
End Sub
Print "不及格者:"
For i = 0 To 9
k = s(i)
e = y(i)
a = (k + e) \ 2
If a < 60 Then
Print x(i); ":"; "数学 "; k; " 语文 "; e; " 平均分 "; a
End If
End Sub
2005-10-31 22:24
快速回复:怎么统计啊???
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023973 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved