登录
首页 » Visual C++ » 2.3

2.3

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

  • VCGAME
    本文件夹提供了扫雷游戏、俄罗斯方块等游戏的源码(this is a good source code)
    2010-11-23 19:09:49下载
    积分:1
  • bug
    一个基于C++的打虫子游戏,难度递增,虫子的轨迹随机。(A C++ to play insect games, difficulty increase.)
    2013-10-29 09:30:14下载
    积分:1
  • vc五子棋网络版本1.0
    网络五子棋系统,用vc实现.学习vc对话框编程,网络编程。(331 network system, using vc achieve. Learning vc dialog programming, network programming.)
    2005-06-16 12:03:04下载
    积分:1
  • qqgame
    手机QQ游戏大厅jar可以下载到java手机上运行使用(QQgame jar)
    2020-06-25 22:20:02下载
    积分:1
  • 675646545
    VB反应能力测试小游戏,打地鼠源代码.有需要的下.(VB reaction capability test game, play hamster source code are in need.)
    2013-08-23 17:56:27下载
    积分:1
  • zhongguoxiangqiCPP
    c语言版本中国象棋,完美实现经典象棋的c语言程序源代码。(c language version of Chinese chess, the perfect realization of the classic chess c language program source code.)
    2013-09-29 16:14:03下载
    积分:1
  • zhuangqiu
    一款非常简单的撞球游戏,使用方向键控制板块左右弹动小球即可得分。(one very simple game of pool, use the direction keys to control plate at about moving the ball can score.)
    2006-07-31 23:11:57下载
    积分:1
  • Snake
    一个基于Visual C++的简单的贪吃蛇小游戏(Snake game)
    2016-01-21 14:34:12下载
    积分:1
  • Guess
    猜数字游戏,类似于文曲星上的猜数字游戏,窗口化的MFC程序(猜数字game, similar to文曲星on猜数字game of MFC windows program)
    2009-05-01 19:02:47下载
    积分:1
  • SingleNumber
    找出只出现一次的数字,其他数字均出现了2次,时间空间尽量少(Identify only appears once, while other figures have appeared two times to minimize time and space)
    2013-10-24 09:01:25下载
    积分:1
  • 696516资源总数
  • 106415会员总数
  • 3今日下载