登录
首页 » Visual C++ » 2.3

2.3

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

  • sdk_jyt
    说明:  用SDK写的劲乐团游戏 对学SDK很有帮助(using the SDK to write strong game Orchestra SDK helpful for school)
    2006-04-12 20:14:38下载
    积分:1
  • tmp
    编写一个模拟人工洗牌的程序,将洗好的牌分别发给四个人。 使用结构card 来描述一张牌,用随机函数来模拟人工洗牌的过程,最后将洗好的52张牌顺序分别发给四个人。 对每个人的牌要按桥牌的规则输出。即一个人的牌要先按牌的花色(顺序为梅花、方块、红心和黑桃)进行分类,同一类的牌要再按A、K、Q、J、…、3、2牌的大小顺序排列。另发牌应按四个人的顺序依次分发。(Write a simulation program manual shuffle, the cards were sent to wash a good four. Card use to describe the structure of a card, with the random function to simulate the manual process of shuffling, and finally wash the good order of 52 cards were issued to four people. Cards for each person according to the rules of bridge output. That is, a person' s license have to press the card suit (in order of clubs, diamonds, hearts and spades) classification, the same type of licenses to press A, K, Q, J, ..., 3,2 card the size of the order. The other four licensing the order should be distributed.)
    2011-11-30 13:15:30下载
    积分:1
  • GuessNumber
    说明:  猜数字游戏 计算机随机产生一个无重复数字的四位数 若所猜的数位置与数字均正确,会显示一个A,若数字对位置不对,会显示一个B.(Number guessing game is a computer randomly generated four-digit number without repetition by the guess that if the number of locations and figures are correct, will show an A, if the number of position wrong and they' ll show a B.)
    2021-03-22 08:19:17下载
    积分:1
  • zuma
    祖玛小游戏 实现基本功能 基本算法 给大家参考一下 地图两种圆形 和 直线(Zuma game to achieve the basic functions basic algorithm to refer to two kinds of circular and linear maps)
    2013-09-02 22:50:26下载
    积分:1
  • brick
    这是一个俄罗斯方块的游戏,用VC++MFC编写的(This is a game)
    2009-07-13 21:23:11下载
    积分:1
  • SMO-8.1.8.24
    这个是网络游戏石器时代的源码,有需要的可以下载。(This is the online game Stone Age of the source, there is a need can be downloaded.)
    2010-11-15 16:26:11下载
    积分:1
  • VC6Games
    VC6GamesVC++游戏编程经典教材,包括扫雷,五子棋,俄罗斯方块,老鼠和滚球,飞机游戏,五子棋等游戏是实现过程和代码讲解(VC6GamesVC++ game programming classic textbooks, including mine, backgammon, Tetris, mice and bowls, aircraft games, backgammon and other games is to realize the code explain the process and)
    2010-05-19 23:44:30下载
    积分:1
  • 2166e302b7491156ad4900ba2a3d1620
    改魔兽地图的如侵犯别人的版权请通知我我立即删掉着个东西(Changes, such as World of Warcraft Maps copyright infringement, please inform me of others I immediately deleted the one thing)
    2011-05-23 22:27:56下载
    积分:1
  • OgreVideoPlayer
    使用三维开源引擎OGRE 播放视频的源代码 游戏编程粉可以给自己的游戏加上过场动画啦!(Use the source code of the open source 3D engine OGRE play video game programming powder can give their own game with cut scenes it!)
    2013-01-16 09:46:02下载
    积分:1
  • (含开发文档)坦克大战2(成品+源码+报告)
    坦克大战游戏,源代码加成品。喜欢的可以下载玩一下(this game is tank game)
    2019-05-21 17:53:00下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载