登录
首页 » Visual C++ » 2.3

2.3

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

  • -the-poker-game
    本程序利用Card类数组模拟扑克牌,定义3个数组分别表示玩家手中的牌,电脑手中的牌和底牌,用srand((unsigned)time(NULL))产生随机数字,将底牌数组中随机的一项从底牌中移动到其他的数组中,模拟从洗好底牌中抓牌。表示出牌。 单人练习模式中,首先记下一个 1到13之间的随机数字,然后玩家抓牌,当手中的牌的点数恰与记下的随机数字相等,或用手中有的任意两张牌,通过加减乘除四则运算可以凑出该随机数字相等的点数,则停止抓牌并将这一张或两张出出去,随即记下一个新的随机数字,开始下一轮,直道手中的全部牌出完,游戏结束(This procedure using Card class array to simulate playing cards, the definition of the 3 arrays represent the game player cards, computer cards and cards, using srand ((unsigned) time (NULL)) to generate random numbers, random number in the array will be a move to the number of cards from other groups of cards, simulation from the wash hand in. Said. Single practice mode, first recorded random number between 1 to 13 next, and then the game player to draw cards, random number equal when the hand points exactly with the down, or in the hands of some arbitrary two cards, add, subtract, multiply and divide by four operations can make the random number equal points, then stop to draw a card and the card or two cards out, then write a new random number, start the next round, straight hands all the cards out, the end of the game)
    2013-08-19 15:13:48下载
    积分:1
  • ptdma
    可把一块图片分割几部份,切片数量可由用户定制,游戏开始后顺序打乱,然后让你拼图。(A picture can be split into several parts, cut the number of user customization, upset the order after the start of the game, and then let you puzzle.)
    2011-04-20 22:12:07下载
    积分:1
  • GreedySnake
    用VC编写的贪吃蛇游戏。界面很好,没怎么调用API或者使用MFC主要是借用第三方graphics库(tanchisheyouxi,henhaowan,xiazaixiakaikankan )
    2012-05-12 23:56:50下载
    积分:1
  • ttq
    VC++开发的跳跳棋益智小游戏,跳跳棋益智游戏(Jumping chess program VC++ developed jumping chess puzzle game)
    2012-07-25 22:11:54下载
    积分:1
  • Eluosi
    以前写的一个俄罗斯方块程序 纯Windows API 和 GDI接口编写的 是学习Windows编程的好例子(A Tetris program used to write pure Windows API the GDI interface to write is a good example to learn Windows programming)
    2012-09-07 13:12:21下载
    积分:1
  • jiaotashidi
    这是一个名为"脚踏实地"的游戏,内含游戏规则,可以需要选择游戏地图,找出口,是游戏编程的入门之一.(This is a "down-to-earth" of the game, containing the rules of the game and can choose the game map, for export, the game is one of the program's portal.)
    2007-04-20 11:02:00下载
    积分:1
  • game
    vb.net实现的打砖块小游戏的基本操作和功能(basic operations and functions of vb.net achieve Arkanoid game)
    2013-03-06 11:33:40下载
    积分:1
  • clock21
    推箱子是一款风靡全球的益智小游戏,老少都可以玩,覆盖面很广。(The push box is a popular puzzle game all over the world. All the young and old can play with a wide range of coverage.)
    2018-03-21 08:14:50下载
    积分:1
  • 24Points
    24点游戏,找出所有解。给任意4个数,该程序能找出所有通过加,减,乘,除,括号算出24结果的算式。(24-point game, find all solutions. To any four numbers, the program can identify all through add, subtract, multiply, divide, calculate 24 results parentheses formula.)
    2013-08-19 12:02:21下载
    积分:1
  • zoumigong
    用VC++设计的一个走迷宫的小游戏,界面显示,用键盘控制人物走动(Designed with a maze of VC Games,Interface display, using the keyboard to control the characters move)
    2011-12-06 16:47:55下载
    积分:1
  • 696518资源总数
  • 106222会员总数
  • 14今日下载