编程作业-数字游戏
编程作业-数字游戏
Module Module1
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
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
侯亚朋-07网1- 帖子数 : 2
注册日期 : 08-03-21
您在这个论坛的权限:
您不能在这个论坛回复主题