.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:03 am

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

侯亚朋-07网1

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

返回页首 向下

返回页首


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