登录
首页 » Visual C++ » 2.3

2.3

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

  • megatetris1
    Super Tetris. Greateast Game. Have fun!
    2010-01-07 21:34:11下载
    积分:1
  • KeyDrum-(3)
    Subject : KeyDrum Development Suft : VC 2008 Language : MFC(GDI++), C/C++
    2012-08-05 13:57:43下载
    积分:1
  • Eight-Queens-Games
    说明:  八皇后小游戏,实现说明,以及代码实现原文件。(Eight Queens game to achieve that, and the code of the original document.)
    2011-03-07 23:02:18下载
    积分:1
  • Visual_C++GameDevelop
    Visual C++游戏开发技术与实例一书配套光盘。包含了冒险屠宰场、入侵者、赛车、网络五子棋、网络台球、对战坦克大战和面包圈7个游戏实例的完整源代码。(Visual C++ Game development technology and examples of a book supporting CD-ROM. Contains adventure slaughterhouse, the invaders, car, network Gobang, network billiards, donut war Tankedaizhan and seven examples of a complete game source code.)
    2020-06-26 03:40:02下载
    积分:1
  • GG
    说明:  很好玩的遊戲 需要靠反應力和眼力 超級好玩的喔 趕快下載吧(Very fun game and needs to depend on the reaction of super-fun喔eye as soon as possible to download it)
    2008-02-01 02:07:49下载
    积分:1
  • csxyy
    这是非常好玩的小游戏_猜数,试于初级选手参考.(This is a very fun game _ guess small number of junior players in the test reference.)
    2007-05-15 13:37:27下载
    积分:1
  • black_white_chess
    black white chess black white chess black white chess black white chess
    2009-09-19 16:14:31下载
    积分:1
  • Mine-clearance-procedures
    扫雷游戏的源代码,扫雷游戏是经典的益智类游戏,源代码简明易懂。(A game of Mine clearance procedures.)
    2012-05-06 12:56:45下载
    积分:1
  • Guess
    猜数字游戏,类似于文曲星上的猜数字游戏,窗口化的MFC程序(猜数字game, similar to文曲星on猜数字game of MFC windows program)
    2009-05-01 19:02:47下载
    积分:1
  • 3d_simple
    directx 3d游戏的简单制作,对于新手是个号例子(directx 3d game simple production example for the novice is No.)
    2020-07-04 23:20:01下载
    积分:1
  • 696518资源总数
  • 106155会员总数
  • 8今日下载