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

作业(小游戏)

向下

作业(小游戏) Empty 作业(小游戏)

帖子  李晓光(网络一班) 周五 三月 21, 2008 4:15 pm

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

李晓光(网络一班)

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

返回页首 向下

返回页首


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