登录
首页 » Visual C++ » 2.3

2.3

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

  • ysdemo
    永远的伊苏同人游戏.引擎开发+地图编辑器+脚本编辑器+主角/NPC/怪物/魔法编辑器+图片处理器+剧情设计(Ys Game Forever colleagues. Engine+ map editor+ Script Editor+ characters/NPC/monster/magic Editor+ story+ picture processor design)
    2021-04-29 14:18:43下载
    积分: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
  • shudu
    一个数独游戏的源码程序,有兴趣的朋友可以下来看看(A Sudoku game source program, interested friends can look down)
    2014-02-27 10:58:56下载
    积分:1
  • BubblesGame
    用游戏引擎模仿flash做得小型游戏,可以自动记录分数,有自己得关卡(Flash game engine used to do small-scale imitation game, you can automatically record scores have have their own points)
    2009-04-10 18:03:16下载
    积分:1
  • CuraEngine-master
    3维切片算法引擎写上传资料的详细功能、包含内容说明(至少要20个字)。尽量不要让站长把时间都花费在为您修正说明上。压缩包解压时不能有密码。(Three dimensional slice algorithm engine written detailed upload function, including the content description (at least 20 characters). Try not to let station to the time spent on your note on the amendment. Extracting compressed package can not have a password.)
    2013-11-08 10:19:08下载
    积分:1
  • game
    vb.net实现的打砖块小游戏的基本操作和功能(basic operations and functions of vb.net achieve Arkanoid game)
    2013-03-06 11:33:40下载
    积分:1
  • UDKDOC
    UDKDOC to tell us how to use UDK engine to develop game, and this is written in chinese.
    2013-07-03 23:09:26下载
    积分:1
  • wzq
    五子棋小程序,实现双人对抗,能完成悔棋,复盘,等基本功能。在玩棋时,能自动判禁手以及判赢。(Gobang small procedures, to achieve double confrontation, to complete悔棋, rehabilitation sites, such as basic features. Playing chess, they can automatically cut the hands and sub-contractors to win.)
    2008-06-26 21:47:09下载
    积分:1
  • snake
    很简单的贪吃蛇,用的都是WINDOWS的API,不过是早期写的,可能可读性上差点,新手可以看(Snake is very simple)
    2011-07-09 18:38:28下载
    积分:1
  • games
    小精灵游戏,C++的课程设计的作业。关于游戏的初步学习(little games of a small program )
    2020-07-04 16:20:02下载
    积分:1
  • 696518资源总数
  • 105895会员总数
  • 18今日下载