作业(小游戏)
作业(小游戏)
Sub Main()
Console.WriteLine("请输入0~9的任意数字")
Dim a As String = Console.ReadLine()
Dim b As String
Dim c As String '定义a,b,c三个输入变量
Dim z As String = 5
Dim y As String = 4
Dim x As String = 9 '定义z,y,x三个常量
If a = z Then
Console.WriteLine("go!")
b = Console.ReadLine '当输入的a与z的值相同时,继续输入b的值
If b = y Then
Console.WriteLine("go!")
c = Console.ReadLine '当输入的b的值正确时。继续输入c的值
If c = x Then
Console.WriteLine("Great,Congratulations!")
Else : Console.WriteLine("gameover......")
End If
Else : Console.WriteLine("gameover......")
End If
Else : Console.WriteLine("gameover......")
End If
End Sub
End Module
Console.WriteLine("请输入0~9的任意数字")
Dim a As String = Console.ReadLine()
Dim b As String
Dim c As String '定义a,b,c三个输入变量
Dim z As String = 5
Dim y As String = 4
Dim x As String = 9 '定义z,y,x三个常量
If a = z Then
Console.WriteLine("go!")
b = Console.ReadLine '当输入的a与z的值相同时,继续输入b的值
If b = y Then
Console.WriteLine("go!")
c = Console.ReadLine '当输入的b的值正确时。继续输入c的值
If c = x Then
Console.WriteLine("Great,Congratulations!")
Else : Console.WriteLine("gameover......")
End If
Else : Console.WriteLine("gameover......")
End If
Else : Console.WriteLine("gameover......")
End If
End Sub
End Module
李晓光(网络一班)- 帖子数 : 2
注册日期 : 08-03-18
您在这个论坛的权限:
您不能在这个论坛回复主题