实习题——折扣问题和数字游戏
实习题——折扣问题和数字游戏
商场折扣问题
Sub Main()
Dim a As Integer = Console.ReadLine
Dim b As Integer
If a < 1000 Then
b = a
ElseIf a >= 1000 And a < 2000 Then
b = a * 0.95
ElseIf a >= 2000 And a < 3000 Then
b = a * 0.9
ElseIf a >= 3000 And a < 5000 Then
b = a * 0.85
ElseIf a >= 5000 Then
b = a * 0.8
Console.WriteLine(b)
End If
End Sub
数字游戏
Sub Main()
Dim a As Integer = Console.ReadLine
If a = 5 Then
Console.WriteLine("对了,继续猜!")
Else : End
End If
Dim b As Integer = Console.ReadLine
If b = 6 Then
Console.WriteLine("对了,再猜!")
Else : End
End If
Dim c As Integer = Console.ReadLine
If c = 7 Then
Console.WriteLine("对了!")
Else : End
End If
Sub Main()
Dim a As Integer = Console.ReadLine
Dim b As Integer
If a < 1000 Then
b = a
ElseIf a >= 1000 And a < 2000 Then
b = a * 0.95
ElseIf a >= 2000 And a < 3000 Then
b = a * 0.9
ElseIf a >= 3000 And a < 5000 Then
b = a * 0.85
ElseIf a >= 5000 Then
b = a * 0.8
Console.WriteLine(b)
End If
End Sub
数字游戏
Sub Main()
Dim a As Integer = Console.ReadLine
If a = 5 Then
Console.WriteLine("对了,继续猜!")
Else : End
End If
Dim b As Integer = Console.ReadLine
If b = 6 Then
Console.WriteLine("对了,再猜!")
Else : End
End If
Dim c As Integer = Console.ReadLine
If c = 7 Then
Console.WriteLine("对了!")
Else : End
End If
高璐- 帖子数 : 1
注册日期 : 08-03-18
您在这个论坛的权限:
您不能在这个论坛回复主题