商品打折问题
商品打折问题
Module Module1
Sub Main()
Dim x As Single = Console.ReadLine
Dim y As Single
If x > 1000 And x <= 2000 Then
y = x * 0.95
ElseIf x > 2000 And x <= 3000 Then
y = x * 0.9
ElseIf x > 3000 And x <= 5000 Then
y = x * 0.85
ElseIf x >= 5000 Then
y = x * 0.8
ElseIf x <= 1000 Then
y = x
End If
Console.WriteLine(y)
End Sub
End Module
Sub Main()
Dim x As Single = Console.ReadLine
Dim y As Single
If x > 1000 And x <= 2000 Then
y = x * 0.95
ElseIf x > 2000 And x <= 3000 Then
y = x * 0.9
ElseIf x > 3000 And x <= 5000 Then
y = x * 0.85
ElseIf x >= 5000 Then
y = x * 0.8
ElseIf x <= 1000 Then
y = x
End If
Console.WriteLine(y)
End Sub
End Module
马晓玲(网三)- 帖子数 : 1
注册日期 : 08-03-20
您在这个论坛的权限:
您不能在这个论坛回复主题