登录
首页 » Visual C++ » 2.3

2.3

于 2010-11-03 发布 文件大小:1KB
0 165
下载积分: 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 个回复

  • eluosi
    用c++编写的俄罗斯方块小游戏,有兴趣的可以学习下(With c++ Tetris game, interested can learn under)
    2013-10-15 22:11:42下载
    积分:1
  • wangloucaishuozi
    網絡對戰猜數字,可以网络对战的,VB编写的(Network猜数字war, the war can network, VB prepared)
    2009-01-05 20:55:07下载
    积分:1
  • Cpp2
    连连看游戏的雏形,适合编程者初学阶段。望签收(lianliankan game)
    2012-01-17 09:45:22下载
    积分:1
  • MapEditor_bate
    说明:  一个游戏开发能用到的地图编辑器项目完整代码,既可以研究学习也可以使用他开发RPG游戏(Game developers can use a map editor to project a complete code, we can study to learn he can also use the development of RPG games)
    2008-10-29 16:19:37下载
    积分:1
  • view2
    游戏地图编辑器一个基于VC++ MFC DX9 的地图编辑工具(Game map editor based on VC++ MFC DX9 map editing tools)
    2013-08-29 09:05:08下载
    积分:1
  • caishuzi
    说明:  用VB编写的一个小游戏:猜数字.简单易懂.很好操作.并且有论文稿(VB prepared with a small game:猜数字. Easy. A very good operation. And a draft paper)
    2008-11-26 22:35:54下载
    积分:1
  • sdk_dfj
    说明:  一个用SDK写的打飞机游戏 对学SDK很有帮助(an SDK with the aircraft was made to learn the game SDK helpful)
    2006-03-29 22:17:14下载
    积分:1
  • chess
    中国象棋网络对战代码,网络资源,刘为民整理并加入部分功能。liu_wei_min63@163.com(Chinese Chess online play code, network resources, Liu Weimin organize and join function. liu_wei_min63@163.com)
    2009-12-02 17:28:45下载
    积分:1
  • bomb-game
    扫雷游戏的C++代码,适用于学习C++的初学者,有助于理解程序,提升能力。( Minesweeper game C++ code, suitable for beginners to learn C++, to help understand the process, enhance the capacity. Minesweeper game C++ code, suitable for beginners to learn C++, to help understand the process, enhance the capacity.)
    2014-01-03 10:24:46下载
    积分:1
  • m1_2010Mar13
    MAME的游戏音乐播放DLL原代码,MAME的游戏音乐播放DLL原代码(MAME game DLL source code music playerMAME game DLL source code music player)
    2010-07-10 23:21:18下载
    积分:1
  • 696518资源总数
  • 106208会员总数
  • 21今日下载