云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 教材习题及答案

教材习题及答案

  • 62 次阅读
  • 3 次下载
  • 2025/5/6 15:23:47

‘—7—

Module Module1

Sub Main()

Dim A() As Integer = {23, 34, 56, 78, 12, 2, 45, 6, 7, 90} Dim x As Integer = 56

Console.WriteLine(\

End Sub

Function IsHere(ByVal A() As Integer, ByVal x As Integer) As Integer For i As Integer = 0 To A.Length - 1 If x = A(i) Then Return i End If Next Return -1 End Function

End Module

‘—8—

Module Module1

Sub Main()

Console.WriteLine(\请输入工作时间,工作年数(整数),以空格分隔并以回车结束\

Dim s0 As String = Console.ReadLine() Dim sSplit() As String = s0.Split(\

Dim t, y, sperh As Integer t = Convert.ToInt32(sSplit(0)) y = Convert.ToInt32(sSplit(1)) Dim s As Single

If y >= 5 Then sperh = 50 Else

sperh = 30 End If

If t < 40 Then s = t * sperh

Else

s = 40 * sperh + (t - 40) * sperh * 1.5 End If

Console.WriteLine(\工资是{0:N2}\

End Sub

End Module

‘—9—

Module Module1

Sub Main()

Console.WriteLine(\请输入年 月 日,以空格分隔并以回车结束\ Dim s0 As String = Console.ReadLine() Dim sSplit() As String = s0.Split(\

Dim y, m, d As Integer

y = Convert.ToInt32(sSplit(0)) m = Convert.ToInt32(sSplit(1)) d = Convert.ToInt32(sSplit(2))

Dim s As Integer = 0 Dim mm As Integer

For i As Integer = 1 To m - 1

If ((i <= 7) And (i Mod 2 = 1)) Or ((i >= 8) And (i Mod 2 = 0)) Then mm = 31 Else

If i = 2 And (((y Mod 4 = 0) And (y Mod 100 <> 0)) Or (y Mod 400 = 0)) Then

mm = 29 Else

If i = 2 Then mm = 28 Else

mm = 30 End If End If End If s = s + mm Next s = s + d

Console.WriteLine(\

End Sub

End Module

‘—10—

Module Module1

Sub Main()

Console.WriteLine(\请输入n\

Dim s As String = Console.ReadLine() Dim n As Integer = Convert.ToInt32(s) Dim y As Integer = 1 For i = 1 To n - 1 y = 2 * (y + 1) Next

Console.WriteLine(\桃子数是{0}\ End Sub

End Module

‘—11—

Module Module1

Sub Main()

For x As Integer = 0 To 50

For y As Integer = 0 To 50 - x If x * 2 + y * 4 = 160 Then

Console.WriteLine(\钥匙扣{0}个,漫画书{1}本\ End If Next Next End Sub

End Module

‘—12—

Module Module1

Sub Main()

For x As Integer = 100 To 999 Dim a As Integer = x Mod 10

Dim b As Integer = (x \\ 10) Mod 10 Dim c As Integer = x \\ 100

If a ^ 3 + b ^ 3 + c ^ 3 = x Then

Console.WriteLine(\ End If Next End Sub

End Module

‘—13—

Module Module1

Sub Main()

Dim ins As String = Console.ReadLine() Dim n As Integer = Convert.ToInt32(ins) If IsSquare(n) Then

Console.WriteLine(\ Else

Console.WriteLine(\ End If End Sub

Function IsSquare(ByVal n As Integer) As Boolean Dim i As Integer = 1 For i = 1 To n / i If i * i = n Then Return True End If Next

Return False End Function

End Module

‘—14—

Module Module1 Structure count

Dim x As Integer Dim c As Integer End Structure

Sub Main()

Dim A() As Integer = {2, 3, 3, 3, 4, 5, 5, 5} Dim cou(20) As count Dim i As Integer = 0

For Each k As Integer In A

搜索更多关于: 教材习题及答案 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

‘—7— Module Module1 Sub Main() Dim A() As Integer = {23, 34, 56, 78, 12, 2, 45, 6, 7, 90} Dim x As Integer = 56 Console.WriteLine(\ End Sub Function IsHere(ByVal A() As Integer, ByVal x As Integer) As Integer For i As Integer = 0 To A.Length - 1 If x = A(i) Then Return i

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com