【计算机类职业资格】江苏计算机二级考试+Visual+Basic上机真题一2013年秋季及答案解析.doc

上传人:Iclinic170 文档编号:1335927 上传时间:2019-10-17 格式:DOC 页数:2 大小:32.50KB
下载 相关 举报
【计算机类职业资格】江苏计算机二级考试+Visual+Basic上机真题一2013年秋季及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】江苏计算机二级考试+Visual+Basic上机真题一2013年秋季及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、江苏计算机二级考试+Visual+Basic 上机真题一 2013 年秋季及答案解析(总分:40.00,做题时间:70 分钟)一、【考试须知】(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是生成由 n(n 通过 InputBox 函数输入)个 3 位升序数构成的随机数组,所谓升序数是指从高位到低位数字值依次增加的整数(本程序界面由 1 个 TextBox 和 1 个CommandButton 组成,所有对象均采用缺省名) (分数:14.00)_2.编程题(26 分) 【题目】 编写程序,找出给定范围内所有不是素数的亏数。所谓亏数是指除本身外其所有因子之和小于自身的

2、正整数。例如,106 的因子为 1、2、53,和为 56,故 106 是亏数。(注意:凡因子和为 1 的即为素数) (分数:26.00)_江苏计算机二级考试+Visual+Basic 上机真题一 2013 年秋季答案解析(总分:40.00,做题时间:70 分钟)一、【考试须知】(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是生成由 n(n 通过 InputBox 函数输入)个 3 位升序数构成的随机数组,所谓升序数是指从高位到低位数字值依次增加的整数(本程序界面由 1 个 TextBox 和 1 个CommandButton 组成,所有对象均采用缺省名) (分数:

3、14.00)_正确答案:(第 15 行 Loop Until kn 改为 k=n 第 17 行 Private Function judge(n as integer) As Boolean 改为 Byval n 第 24 行 If a(i)=a(i+1) Then Exit Function 改为 Exit Function)解析:2.编程题(26 分) 【题目】 编写程序,找出给定范围内所有不是素数的亏数。所谓亏数是指除本身外其所有因子之和小于自身的正整数。例如,106 的因子为 1、2、53,和为 56,故 106 是亏数。(注意:凡因子和为 1 的即为素数) (分数:26.00)_正确

4、答案:(Option Explicit Option Base 1 Private Sub CmdClear_Click() Text1.Text = “: Text2.Text = “ List1.Clear Text1.SetFocus End Sub Private Sub CmdFind_Click() Dim a As Integer, b As Integer, i As Integer Dim st As String, flg As Boolean, sum As Integer a = Val(Text1.Text) b = Val(Text2.Text) For i = a

5、 To b flg = False: st = “: sum = 0 Call judge(i, flg, st, sum) If flg Then List1.AddItem i & “:“ & st & “=“ & sum End If Next i If List1.ListCount = 9 Then List1.AddItem “指定范围内无亏数“ End Sub Private Sub judge(n As Integer, fg As Boolean, st As String, sum As Integer) Dim i As Integer For i = 1 To n - 1 If n Mod i = 0 Then sum = sum + i st = st & i & “+“ End If Next i If sum 1 Then fg = True st = Left(st, Len(st) - 1) End If End Sub)解析:

展开阅读全文
相关资源
猜你喜欢
  • ETSI TS 128 707-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference_1.pdf ETSI TS 128 707-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference_1.pdf
  • ETSI TS 128 708-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf ETSI TS 128 708-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf
  • ETSI TS 128 708-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf ETSI TS 128 708-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf
  • ETSI TS 128 708-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf ETSI TS 128 708-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf
  • ETSI TS 128 708-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference_1.pdf ETSI TS 128 708-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference_1.pdf
  • ETSI TS 128 709-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf ETSI TS 128 709-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf
  • ETSI TS 128 709-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf ETSI TS 128 709-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf
  • ETSI TS 128 709-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf ETSI TS 128 709-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference.pdf
  • ETSI TS 128 709-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference_1.pdf ETSI TS 128 709-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Evolved Packet Core (EPC) Network Resource Model (NRM) Integration Reference_1.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1