登录
首页 » Visual C++ » 2.3

2.3

于 2010-11-03 发布 文件大小:1KB
0 151
下载积分: 1 下载次数: 3

代码说明:

  一个简单的猜数游戏程序:  利用Math.random()方法生成0-1之间的double型数dNum,将dNum转换为0-100之间的整数iNum。  利用KeyInput.readInt()方法接收键盘输入的整数inNum。如果inNum小于iNum,在屏幕上显示“输入的值小,请输入更大的数.”;如果inNum大于iNum,在屏幕上显示“输入的值大,请输入更小的数.”;如果inNum等于iNum,在屏幕上显示“猜对了.”,并结束运行。  猜测错误的时候,重新输入inNum,直到猜对为止。如果猜测10次后仍未猜对,显示“猜测次数已达10次,猜数失败.”,并结束程序的运行。 (A simple guessing game program:  use Math.random () method to generate double-type numbers between 0-1 dNum, will dNum into an integer between 0-100 iNum.  use KeyInput.readInt () method receives the keyboard input integer inNum. If inNum less than iNum, the screen " Enter the value of the small, enter the greater number." If inNum than iNum, the screen " Enter the value of the large number of smaller type." If inNum equal iNum, displayed on the screen, " guessed." and end the run.  guess wrong, re-enter inNum, until you guess it right up. If the guess was right 10 times not to show " guess the number has reached 10 times, guess the number of failures." And end the program.)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • wuziqi
    经典的五子棋游戏的代码,用C++编写,可作为C++新手的练习材料,在windows系统上运行(The classic backgammon game code, written in C++, can be used as material for training novice C++, running on the windows system)
    2016-01-18 15:03:30下载
    积分:1
  • majiang
    麻将游戏,在局于网真可以运行,你可以和他们一起来玩,是C/S构架,不修要修改代码(Mahjong games, in the Bureau in TelePresence can run, you can play with them is the C/S architecture, or revision to amend the code)
    2007-09-29 22:24:42下载
    积分:1
  • kongjingyouxi-
    C语言 矿井游戏源码矿井游戏源码矿井游戏源码(Mine game source Mine game source Mine game source Mine game source )
    2017-05-11 11:18:22下载
    积分:1
  • AdvInAbat
    说明:  一个采用VC+DX8.0编程的2D游戏, 有一定的可玩性. 游戏主题: 屠宰场. 同时, 对于学习DX和VC也有一定的帮助 (using VC DX8.0 a 2D game programming, a certain degree of fun. The game theme : the slaughterhouse. Meanwhile, the study also DX and VC can help)
    2005-10-13 17:11:32下载
    积分:1
  • 2.2LOD
    LOD地形的一个例子·近远摄像机观察三角面得不同个数(hellow)
    2009-11-16 15:52:21下载
    积分:1
  • pintu
    用MFC编写的拼图游戏,可以在VC++6.0环境下编译成功(Written with MFC jigsaw puzzle, can be in vc++ 6.0 compiled under the environment of success)
    2011-12-21 21:41:51下载
    积分:1
  • Backgammon
    五子连珠的VC源码,简单有趣 (Five or VC source, easy and fun )
    2013-07-20 17:54:18下载
    积分:1
  • MineSweeping
    扫雷 用VS写的,C++程序 MFC程序。学习C++的好源码(Mine clearance to use VS to write the program C++ MFC program. Learning of a good source of C++)
    2012-06-21 22:16:13下载
    积分:1
  • WindowsGame2
    一個簡單得搶旗子遊戲用上下左右移動WINDOWS GAME(Grab a simple flag games to move up and down)
    2012-10-26 22:11:24下载
    积分:1
  • Search-maze-game
    搜寻迷宫小游戏,将球抛出,自动会找出正确出口。(Search maze game, the ball will be thrown, will automatically find the correct exports)
    2013-11-11 10:48:01下载
    积分:1
  • 696518资源总数
  • 105877会员总数
  • 14今日下载