登录
首页 » Visual C++ » 2.3

2.3

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

  • MemWord
    Game Memories Words with dics
    2010-08-13 03:22:43下载
    积分:1
  • JYNet
    俄罗斯方块 联网版 不错很好,功能齐全。(Networked version of Tetris)
    2011-10-01 09:48:17下载
    积分:1
  • go
    说明:  一款很好玩的射击游戏,用visual c++ 实现(A lot of fun shooting game, with visual c++ Implementation)
    2010-05-06 09:25:41下载
    积分:1
  • chenjie
    一个简单的龚 GDI 开发的一个小游戏,喜欢的大家分线一下。(无)
    2010-08-11 13:26:46下载
    积分:1
  • Creating-Games-in-CPP---A-Step-by-Step-Guide-doc
    Creating Games en c++ step by step
    2012-02-04 09:56:55下载
    积分:1
  • surakarta
    这是一个苏拉卡尔塔的程序 包括界面设计和后台代码(This is a program of Surakarta, including interface design and code-behind)
    2020-10-22 17:47:23下载
    积分:1
  • snake
    简单的贪吃蛇游戏,可以选择速度,可以简单的实现贪吃蛇的基本功能,有背景音乐可以播放(a greedy snake that eats candy,the speed of the lake can be set,there is also the background music playing)
    2013-05-29 14:03:11下载
    积分:1
  • KeyDrum-(3)
    Subject : KeyDrum Development Suft : VC 2008 Language : MFC(GDI++), C/C++
    2012-08-05 13:57:43下载
    积分:1
  • cHitChecker_src
    说明:  游戏的算法 碰撞检测 开发环境是VC 库DIRECTX8.1(games collision detection algorithm development environment for VC DIRECTX8.1)
    2006-02-14 18:13:35下载
    积分:1
  • view2
    游戏地图编辑器一个基于VC++ MFC DX9 的地图编辑工具(Game map editor based on VC++ MFC DX9 map editing tools)
    2013-08-29 09:05:08下载
    积分:1
  • 696518资源总数
  • 104349会员总数
  • 32今日下载