登录
首页 » Visual C++ » 2.3

2.3

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

  • heibaiqi
    人人对战的黑白棋(Everyone against Riversi)
    2008-06-08 12:23:31下载
    积分:1
  • tree
    森林的布局,游戏当中,场景和人物的关系,在前面,还是后面,遮隐效果(The layout of the forest, games, the relationship between scenes and characters in front or behind, nothing hidden effects)
    2008-01-17 14:16:16下载
    积分:1
  • stone_choice
    很小很经典的一个游戏——取石子,一次只允许取1到3的整数,最后取走石子的一方失败。(A small classic games- from stone, to allow only take a 1-3 integer, and finally took away the stones of one loser.)
    2008-12-26 15:22:54下载
    积分: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
  • flychess
    用MFC编写的飞行棋游戏,包括游戏界面、核心算法、走棋动画的实现。(Prepared using MFC flight chess games, including the game interface, the core algorithm, take the chess animation implementation.)
    2021-04-24 14:18:47下载
    积分:1
  • C_lanugae_BlackAndWhiteGames
    黑白棋小程序的源代码,黑白棋的是一种智力游戏,采用了C++来实现这一种经典游戏(Othello applet source code, Othello is a mental game, using the C++ to achieve this a classic game)
    2010-12-23 14:10:49下载
    积分:1
  • Tetris-c
    俄罗斯方c语言代码加详解,非常好的俄罗斯方块代码(Russian side c language code plus detailed, very good Tetris code)
    2013-11-27 18:32:17下载
    积分:1
  • STUPID.C
    This is a game about guessing stupid problem relate to AI with some tricks in C programming.
    2015-12-15 12:05:35下载
    积分:1
  • LinkGame
    Visual C#智能设备程序设计,游戏实例(Visual C# Smart Device Programming)
    2010-11-29 19:01:23下载
    积分: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
  • 696516资源总数
  • 106914会员总数
  • 0今日下载