回 帖 发 新 帖 刷新版面

主题:vb上机题如何自动阅卷

这是高中生的VB操作题,如何自动对里面的代码进行检测,判断代码正确与否

如果能判断学生完善代码后,检测运行程序的结果正确与否,也可

 

代码如下:

' 算法描述:
'
'
'
'注意事项:
'
'   1、请在 func() 函数中实现算法,返回算法结果
'   2、请不要修改 Main() 过程
'

Function func()
  Dim a As Integer, x As Integer
  a = 178
  If a / 2 = Int(a / 2) Then '划线
      x = 0
  Else
      x = 1 '线部分
  End If   '线部分
  func = x
End Function

'
' 请不要修改 Main() 过程 !
'
Sub Main()

    If Command = "assess" Then
   
        Open "in.txt" For Input As #1
        Line Input #1, n
        Close #1
   
        Open "out.txt" For Output As #1
        Print #1, func()
        Close #1
                       
    Else
       
      
        MsgBox func()
   
    End If

End Sub

 

回复列表 (共2个回复)

沙发

Major League Baseball "45" number. So then [url=http://www.cheapjordanforsale.us/air-jordan-4-retro-c-4.html]retro jordan 4[/url] shoes followed by No. 45 embroidered white line no.3, 5000 dollar fines dispute In the second game of the Eastern Conference [url=http://www.cheapjordanforsale.us/air-jordan-6-retro-c-6.html]retro jordan 6[/url] semifinals, the Father re-donned the jersey number "23", scored 38 points, but the foot wear or [url=http://www.cheapjordanforsale.us/air-jordan-7-retro-c-8.html]retro jordan 7[/url] embroidered with "45" was too black and white [url=http://www.cheapjordanforsale.us/air-jordan-9-retro-c-9.html]retro jordan 9[/url], then the Bulls away combat, black and white home color [url=http://www.cheapjordanforsale.us/air-jordan-10-retro-c-10.html]retro jordan 10[/url] and away the color does not match, so the Father was also fined $ 5,000 per game, the Father suddenly re-wear jersey No. 23, again by a [url=http://www.cheapjordanforsale.us/air-jordan-11-retro-c-11.html]retro jordan 11[/url] fine of $ 25,000 per game. concord directly translated into "Concord grapes", varieties of Americas grapes, [url=http://www.cheapjordanforsale.us/air-jordan-11-retro-c-11.html]jordan 11 Concord[/url] crystal outsole echoes the color with purple soles, while the color name from the soles of purple the no.5, hot on sale very terrible [url=http://www.cheapjordanforsale.us/air-jordan-12-retro-c-12.html]retro jordan 12[/url] finally listed, each Offer shops outside there are people waiting in line, some people even crushed glass [url=http://www.cheapjordanforsale.us/air-jordan-13-retro-c-13.html]retro jordan 13[/url] doors across the security downtown into the store to try to steal these shoes, in order to buy it at all costs, its all crazy!

板凳

这个很难,因为现在就损算是国家计算机等级考试,用的也是根据值来判断程序正确与否的方法。

我来回复

您尚未登录,请登录后再回复。点此登录或注册