第7讲循环结构学习课件.pptVIP

  • 10
  • 0
  • 约1.37万字
  • 约 68页
  • 2016-12-07 发布于江苏
  • 举报
将此程序用do……loop while语句改写 * * * * * B、第一次:K=1,c=1+3=4; 第二次:K=5,c=4+3=7; * 代码 Private Sub Command1_Click() Dim total As Integer :Dim mark As Integer Dim num As Integer :Dim Average As Single total = 0 :num = 0 Do While mark -1 mark = Val(InputBox(输入-1时循环结束, 请输入专家打分)) total = total + mark num = num + 1 Loop Average = total / num MsgBox 平均得分是: Average End Sub 练 习 运行下面程序后,循环体执行了______次。 i = 0: n = 1 Do While i 32 i = (i + 1) * (i + 1) n = n + 1 Loop Print n A. 2

文档评论(0)

1亿VIP精品文档

相关文档