登录
首页 » Visual C++ » 2.3

2.3

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

  • 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
  • source-code-VC-P-P-Othello
    说明:  带背景音乐的VC++黑白棋源代码,程序简单又娱乐(With background sound source code VC++ Othello)
    2011-03-13 18:32:24下载
    积分:1
  • bomballs
    VB模拟小球碰撞,随机产生不同质量大小的小球,可以改变初始速度和动能损失率,适合初学者(VB simulation of small ball collision, randomly generated different quality size ball, can change the initial velocity and kinetic energy loss rate, suitable for beginners)
    2011-12-11 21:42:59下载
    积分:1
  • Minecraft多功能压测-假人-motd-srv转发
    说明:  Minecraft 假人压测 SRV转发 代理IP获取(Minecraft Dummy pressure measurement SRV forwarding Proxy IP acquisition)
    2021-04-12 14:38:57下载
    积分:1
  • mpxviewer
    A viewer for the games Metroid Prime 1-3 (A viewer for the games Metroid Prime 1-3 This was a research project I did to mainly help me understand how to do 3D programming, early in the beginning revel8n messaged and asked if I wanted to help, heck yes I did.)
    2011-05-25 11:36:50下载
    积分:1
  • vcmap
    编游戏-地图编辑器 VC写得一个地图编辑器 用于游戏引擎的开发(Code Game- map editor)
    2010-08-12 10:39:15下载
    积分:1
  • Snake
    贪吃蛇入门版,带有注释,希望能有助于大家的进步与学习(Snake Starter Edition, with Notes, we hope to contribute to the progress and learning)
    2013-11-17 16:04:56下载
    积分:1
  • light
    3D游戏中关于灯光的编程的几个小例子,对灯光的理解很有帮助(the light program in 3D games)
    2009-06-15 09:59:55下载
    积分:1
  • windonh
    获取窗口句柄,向窗口发送键盘、鼠标控制命令。比如,向游戏(Gets the window handle to the window to send keyboard and mouse control commands. For example, the game)
    2013-05-26 22:41:09下载
    积分:1
  • source
    《Visual C++游戏开发经典案例详解》书中的源代码,希望对大家有一些帮助!(" Visual C++ game development classic cases." book of the source code, we hope to have some help! )
    2011-12-27 10:34:45下载
    积分:1
  • 696518资源总数
  • 104269会员总数
  • 31今日下载