ImageVerifierCode 换一换
格式:DOCX , 页数:35 ,大小:20.52KB ,
资源ID:12882781      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/12882781.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C语言二级140上机模拟试题答案.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C语言二级140上机模拟试题答案.docx

1、C语言 二级 140上机模拟试题答案140套模拟试题的简单应用和综合应用的答案一:2(1): index n n+2 n f12(2): s s,s1 str(n) 3:Private Sub C1_Click() Dim x As Integer x = 18000 Do While x 18001 If isprime(x) Then Exit Do x = x +1 Loop Text1.Text = Str(x)End SubPrivate Sub C2_Click() Open App.Path & out5.txt For Output As 1 Print #1, Text1.T

2、ext Close 1End Sub二:2(1): check1.value “” “#” text2.text2(2): 5 x str(x) 3:Dim i As Integer, j As Integer, n As Integer For i = 1 To 7 For j = 1 To 7 If i = 1 Or i = 7 Or j = 1 Or j = 7 Then Sum = Sum + a(i, j) If a(i, j) Mod 7 = 0 Then n = n + 1 End If Next j Next i lblFirst.Caption = Str(n)lblSeco

3、nd.Caption = Str(Sum)三:2(1): or num 2(2):Avg is=85 is=60 end select n-13:Dim b(20) As Single, i As Integer, j As Integer Dim max As Integer For i = 1 To 20 For j = 1 To 5 b(i) = b(i) + a(i, j) Next j b(i) = b(i) / 5 Next i max = b(1) For i = 2 To 20 If max b(j) Then t = b(i) b(i) = b(j) b(j) = t End

4、 If Next j Next i五:2(1): x b(i) Then min = b(i) Next i Label3.Caption = Str(n) Label4.Caption = Str(min)八:2(1):len asc b 2 x(i).caption2(2):la.listcount la la3: eof(1) str(a(i)Dim i As Integer, j As Integer, t As IntegerFor i = 1 To 9 For j = i + 1 To 10 If a(i) a(j) Then t = a(i) a(i) = a(j) a(j) =

5、 t End If Next jNext I九:2(1):command1 label1 control label2.caption2(2):false true 8 03:b(i) = a(i, 1)c(i) = 1For j = 2 To 5 If b(i) a(i, j) Then min = a(i, j) Next j s = s + min Next i s = s /20 Text2.Text = Str(s)十一:2(1):Dim b(100) As Integer, n As Integer Dim i As Integer, max As Integer, min As

6、Integer For i = 1 To 100 If isnarc(a(i) Then n = n + 1 b(n) = a(i) End If Next i max = b(1) min = b(1) For i = 2 To n If max b(i) Then min = b(i) Next i Text1.Text = Str(max) Text2.Text = Str(min)2(2):Dim n As Integer, i As Integer Dim s As Long n = Val(cb1.Text) For i = 1 To 5000 If i Mod n = 0 The

7、n s = s + i Next i Text1.Text = Str(s)3:Dim s1 As Integer, s2 As Integer, s3 As Integer Dim i As Integer, max As Integer, a As String For i = 1 To Len(s) a = Mid(s, i, 1) If a = Or i = Len(s) Then s2 = s2 + 1 If s3 max Then max = s3 s3 = 0 Else s1 = s1 + 1 s3 = s3 + 1 End If Next i Text1.Text = CInt

8、(s1 / s2) Text2.Text = max十二:2(1):1 text1.text command1.enabled=true2(2):List1.List(List1.ListCount - 2) b c3:Dim b(5) As Integer, c(5) As SingleDim i As Integer, j As Integer, n As IntegerFor i = 1 To 5 n = 0 For j = 1 To 40 If a(i, j) = A And m = Z Then n = Asc(m) - Asc(A) + 1 a(n) = a(n) + 1 End

9、If Next i max = a(1) For i = 2 To 26 If max a(i) Then max = a(i) Next i For i = 1 To 26 If a(i) = max Then Text1.Text = Text1.Text & Chr(Asc(A) + i - 1) End If Next i Text2.Text = Str(max)十四:2(1):true timer1.interval=2000 a 02(2):list1.clear 0 list1.list(k) k text2.text3:Dim i As Integer, j As Integ

10、er Dim max As Integer, avg As Single, n As Integer For i = 1 To 5 max = 0: avg = 0: n = 0 For j = 1 To 40 If a(i, j) Mod 2 = 0 Then If max a(i, j) Then max = a(i, j) End If If a(i, j) Mod 2 = 1 Then n = n + 1 avg = avg + a(i, j) End If Next j avg = Int(avg / n * 100 + 0.5) / 100 Label1(i - 1).Captio

11、n = Str(max) Text2(i - 1).Text = Str(avg) Next I十五:2(1):index true false 60 i-12(2):Dim i As Integer, j As Integer, max As Integer Dim f As Integer For i = 1 To 20 max = a(i, 1) For j = 1 To 5 If max max Then max = s1: m2 = s2 s1 = 0 s2 = Else s1 = s1 + 1 s2 = s2 & a End IfNext iText1.Text = maxText

12、2.Text = m2十七:2(1):text1.text list1.listcount-1 text1.text i2(2):Lbound Ubound Finish i-1 3:Dim s As Integer 通用声明Private Sub read_Click() ReadDataEnd SubPrivate Sub calc_Click() Dim i As Integer For i = 1 To 100 If Arr(i) = 50 Then Text1.Text = Text1.Text & Str(Arr(i) s = s + Arr(i) End If Next i Pr

13、int sEnd SubPrivate Sub save_Click() Call WriteData(dataout.txt, s)End Sub十八:2(1):0 2 value caption2(2):Private Sub cb1_Click() l1.FontSize = cb1.TextEnd SubPrivate Sub Cb2_Click() l1.FontName = cb2.TextEnd Sub3:Private Sub C1_Click() Dim i As Integer, x As Integer x = 15000 Do x = x + 1 If isprime(

14、x) Then Exit Do Loop Text1.Text = Str(x)End SubPrivate Sub C2_Click() Open App.Path & out5.txt For Output As #1 Print #1, Text1.Text Close 1End Sub十九:2(1):1001 0 arrn(i)500 sum+arrn(i)2(2):Dim i As Integer, s As Long For i = 0 To 100 If i Mod 7 0 Then s = s + i Next i Fun = s3:mat(n,m) as integer fo

15、r input input#1,mat(i,j)1 sum=sum+mat(3,j)二十:2(1):1001 0 sum+arrn(i) sum/202(2):Dim i As Integer For i = 0 To 200 If i Mod 3 = 0 Then Fun = Fun + i Next I3:Dim i As Integer, j As Integer For i = 1 To 12 For j = 1 To 10 s(i) = s(i) + a(i, j) Next j s(i) = s(i) / 10 Next I21:2(1):Private Sub c1_Click(

16、) Text1.PasswordChar = End SubPrivate Sub c2_Click() Text1.PasswordChar = ?End SubPrivate Sub c3_Click() Text2.Text = Text1.TextEnd SubPrivate Sub Form_Load() Text1.PasswordChar = *End Sub2(2):Private Sub p1_Click() cd1.ShowOpenEnd Sub3:Dim i As Integer, m As String For i = 1 To Len(p) m = Mid(p, i,

17、 1) & m Next i If p = m Then foundhuiwen = True22:2(1):index a2(2):Private Sub c1_Click() If op1.Value Then If op3.Value Then Text1.Text = 我是 & op1.Caption & op3.Caption ElseIf op4.Value Then Text1.Text = 我是 & op1.Caption & op4.Caption End If ElseIf op2.Value Then If op3.Value Then Text1.Text = 我是 &

18、 op2.Caption & op3.Caption ElseIf op4.Value Then Text1.Text = 我是 & op2.Caption & op4.Caption End If End IfEnd Sub3:同第1套模拟试题综合应用23:1(2):计时器属性:enabled:false interval:1000Private Sub Command1_Click() Timer1.Enabled = TrueEnd SubPrivate Sub Command2_Click() Timer1.Enabled = FalseEnd SubPrivate Sub Comma

19、nd3_Click() sub1End SubPrivate Sub Timer1_Timer() Text1.Text = Text1.Text + 1End Sub2(1):AddItem L1.ListIndex2(2):Private Sub c1_Click() If op1.Value Then Text1.Text = 需要1小时 ElseIf op2.Value Then Text1.Text = 需要10小时 ElseIf op3.Value Then Text1.Text = 需要15小时 End IfEnd Sub3:Dim i As Integer, f As Inte

20、ger, n As Integer Dim b As Integer, c As Integer, d As Integer For i = 1 To 100 b = a(i) 100 c = a(i) 10 Mod 10 d = a(i) Mod 10 If a(i) = b 3 + c 3 + d 3 Then n = n + 1 f = f + a(i) End If Next i Text1.Text = Fix(f / n)24:2(1):1001 min minarrN(i)2(2):Dim i As Integer, n As Integer For i = 0 To 1000

21、If i Mod 7 0 Then n = n + 1 Next i Fun = n3:读入数据Private Sub c1_Click() ReadData1 ReadData2End Sub计算Private Sub c2_Click() Dim i As Integer, s As Integer Dim arr3(20) As Integer For i = 1 To 20 arr3(i) = Arr1(i) - Arr2(i) s = s + arr3(i) Next i Print s Call WriteData(dataout.txt, s)End Sub25:2(1):Pri

22、vate Sub Option1_Click() Text1.Alignment = 0End SubPrivate Sub Option2_Click() Text1.Alignment = 2End SubPrivate Sub Option3_Click() Text1.Alignment = 1End SubPrivate Sub Option4_Click() Text1.FontName = 宋体End SubPrivate Sub Option5_Click() Text1.FontName = 黑体End Sub2(2):Timer1.Enabled = False 30 x0

23、 y2 b3:a(n,1) 7 a(n,8)Dim i As Integer, max As Single, j As Integer For i = 1 To 5 If max getmark(i) Then max = getmark(i) j = i End If Next i Text2.Text = athlete(j) Text3.Text = max26:2(1):If op1.Value Then Text1.Text = 我是 & op1.Caption If op2.Value Then Text1.Text = 我是 & op2.Caption If ch1.Value = 1 Then Text1.Text = 我的爱好是 & ch1.Caption If ch2.Value = 1 Then Text1.Text = 我的爱好是 & ch2.Caption If ch1.Valu

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1