.NET自由天空
Would you like to react to this message? Create an account in a few clicks or log in to continue.

实习题——折扣问题和数字游戏

向下

实习题——折扣问题和数字游戏 Empty 实习题——折扣问题和数字游戏

帖子  高璐 周三 三月 19, 2008 9:19 am

商场折扣问题
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

返回页首 向下

返回页首


 
您在这个论坛的权限:
不能在这个论坛回复主题