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

编程作业-价格问题

向下

编程作业-价格问题 Empty 编程作业-价格问题

帖子  侯亚朋-07网1 周五 三月 21, 2008 11:02 am

Module Module1

Sub Main()
Console.Write("请输入您的金额:")
Dim a As Int32 = Console.ReadLine
Dim b As Int32 '定义两个变量,其中a是输入值
If a < 1000 Then
b = a
ElseIf 1000 <= a And a < 2000 Then
b = a * 0.95
ElseIf 2000 <= a And a < 3000 Then
b = a * 0.9
ElseIf 3000 <= a And a < 5000 Then
b = a * 0.85
ElseIf a >= 5000 Then
b = a * 0.8
End If '定义a的取值范围,以及b的表达式

Console.Write("你的优惠金额是:")

Console.WriteLine(b) '输出
End Sub

End Module

侯亚朋-07网1

帖子数 : 2
注册日期 : 08-03-21

返回页首 向下

返回页首


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