登录
首页 » Visual C++ » 2.3

2.3

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

  • wow_winwin_source
    directx版本的wow客户端源码,是国人写的哦(directx version of the wow client source code is written by people oh)
    2008-06-12 09:03:35下载
    积分:1
  • -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
  • tanchi
    这是一个贪吃蛇游戏的源程序,可通过控制蛇身的上下左右移动吃到食物后,蛇身增加,最后可输出成绩(This is a Snake game source code can be up and down by controlling the snake to eat the food and move around, the snake increases, the final output results)
    2010-11-29 13:32:23下载
    积分:1
  • Snake3
    MFC做的贪吃蛇,已经载入了自定义的鼠标,游戏功能已经实现,学MFC的同学可以多多参考(MFC to do the Snake already loaded a custom mouse game function has been achieved, students can learn MFC lot of reference)
    2013-04-29 11:50:39下载
    积分:1
  • eluosi
    用c++编写的俄罗斯方块小游戏,有兴趣的可以学习下(With c++ Tetris game, interested can learn under)
    2013-10-15 22:11:42下载
    积分: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
  • LinkGame
    Visual C#智能设备程序设计,游戏实例(Visual C# Smart Device Programming)
    2010-11-29 19:01:23下载
    积分:1
  • Skyblue_Mine
    一个简单的VC游戏程序,供学习和娱乐使用。(A simple VC game program for both study and entertainment.)
    2009-12-03 18:50:42下载
    积分:1
  • e
    基于c++编程的俄罗斯方块源程序代码 请多多支持 (Please support Tetris based c++ programming source code)
    2013-05-13 20:44:12下载
    积分:1
  • cx
    说明:  用c语言编写的俄罗斯方块,一款益智游戏,挺简单的(C language Tetris, a puzzle game, very simple.)
    2012-12-12 20:46:35下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载