【计算机类职业资格】江苏计算机等级考试二级Visual+BASIC上机真题2012年3月及答案解析.doc

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

1、江苏计算机等级考试二级 Visual+BASIC 上机真题 2012 年 3 月及答案解析(总分:40.00,做题时间:70 分钟)一、考试说明:(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是在六位正整数中查找超级自恋数。如果将一个六位正整数从高位到低位,每两位分为一组,共分为三组,三组数据的立方的和正好等于其本身,则称该六位正整数为超级自恋数。 1 Option Explicit 2 Private Sub CmdFind_Click() 3 Dim k As Long,num()As Integer,fg As Boolean 4 Dim i As Inte

2、ger,st As String 5 st=“ 6 For k=100000 To 999999 7 fg=False 8 Call judge(k,num,fg) 9 If fg Then 10 For i=UBound(num) To 1 Step -1 11 st=st 按“清除“按钮,将两个文本框与列表框清空,焦点置于文本框“A:“上。 3.程序中至少应定义一个通用过程,用于求一个整数各位数字之和或判断一个整数是否是素数(注意:1 不是素数)。 【要求】 将窗体文件和工程文件分别命名为 F2 和 P2,并保存到 T 盘的根目录下。(分数:26.00)_江苏计算机等级考试二级 Visua

3、l+BASIC 上机真题 2012 年 3 月答案解析(总分:40.00,做题时间:70 分钟)一、考试说明:(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是在六位正整数中查找超级自恋数。如果将一个六位正整数从高位到低位,每两位分为一组,共分为三组,三组数据的立方的和正好等于其本身,则称该六位正整数为超级自恋数。 1 Option Explicit 2 Private Sub CmdFind_Click() 3 Dim k As Long,num()As Integer,fg As Boolean 4 Dim i As Integer,st As String 5

4、 st=“ 6 For k=100000 To 999999 7 fg=False 8 Call judge(k,num,fg) 9 If fg Then 10 For i=UBound(num) To 1 Step -1 11 st=st 按“清除“按钮,将两个文本框与列表框清空,焦点置于文本框“A:“上。 3.程序中至少应定义一个通用过程,用于求一个整数各位数字之和或判断一个整数是否是素数(注意:1 不是素数)。 【要求】 将窗体文件和工程文件分别命名为 F2 和 P2,并保存到 T 盘的根目录下。(分数:26.00)_正确答案:( Option Explicit Private Sub

5、CmdFind_Click() Dim a As Integer,b As Integer,ss As Long Dim n As Integer,st As String,k As Integer a=Text1: b=Text2 For n=a To b ss=n*n st=“ k=nsum(ss,st) If prime(k) Then List1.AddItem n & “2=“ & ss & “:“ & st & “=“ & k End If Next n End Sub Private Function nsum(n As Long,st As String) As Integer

6、 Dim p As String,q As String,i As Integer p=CStr(n) For i=1 To Len(P) q=Mid(p,i,1) nsum=nsum+Val(q) st=st & q & “+“ Next i st=Left(st,Len(st)-1) End Function Private Function prime(n As Integer)As Boolean Dim i As Integer If n=1 Then Exit Function For i=2 To Sqr(n) If n Mod i=0 Then Exit Function Next i prime=True End Function Private Sub CmdClear_Click() Text1=“ : Text2=“ List1.Clear Text1.SetFocus End Sub)解析:

展开阅读全文
相关资源
猜你喜欢
  • ETSI TS 132 278-2018 LTE Telecommunication management Charging management Monitoring event charging (V15 0 0 3GPP TS 32 278 version 15 0 0 Release 15).pdf ETSI TS 132 278-2018 LTE Telecommunication management Charging management Monitoring event charging (V15 0 0 3GPP TS 32 278 version 15 0 0 Release 15).pdf
  • ETSI TS 132 280-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Advice of Charge (AoC) service (V13 0 0 3GPP TS 32 280 v.pdf ETSI TS 132 280-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Advice of Charge (AoC) service (V13 0 0 3GPP TS 32 280 v.pdf
  • ETSI TS 132 280-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Advice of Charge (AoC) service (V14 0 0 3GPP TS 32 280 v.pdf ETSI TS 132 280-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Advice of Charge (AoC) service (V14 0 0 3GPP TS 32 280 v.pdf
  • ETSI TS 132 280-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Advice of Charge (AoC) service (V15 0 0 3GPP TS 32 280 v.pdf ETSI TS 132 280-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Advice of Charge (AoC) service (V15 0 0 3GPP TS 32 280 v.pdf
  • ETSI TS 132 281-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Announcement service (V13 0 0 3GPP TS 32 281 version 13 .pdf ETSI TS 132 281-2016 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Announcement service (V13 0 0 3GPP TS 32 281 version 13 .pdf
  • ETSI TS 132 281-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Announcement service (V14 0 0 3GPP TS 32 281 version 14 .pdf ETSI TS 132 281-2017 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Announcement service (V14 0 0 3GPP TS 32 281 version 14 .pdf
  • ETSI TS 132 281-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Announcement service (V15 0 0 3GPP TS 32 281 version 15 .pdf ETSI TS 132 281-2018 Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Announcement service (V15 0 0 3GPP TS 32 281 version 15 .pdf
  • ETSI TS 132 293-2016 Digital cellular telecommunications system (Phase 2+) Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Pr.pdf ETSI TS 132 293-2016 Digital cellular telecommunications system (Phase 2+) Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging management Pr.pdf
  • ETSI TS 132 293-2017 Digital cellular telecommunications system (Phase 2+) (GSM) Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging managem.pdf ETSI TS 132 293-2017 Digital cellular telecommunications system (Phase 2+) (GSM) Universal Mobile Telecommunications System (UMTS) LTE Telecommunication management Charging managem.pdf
  • 相关搜索

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

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