登录
首页 » Visual C++ » 2.3

2.3

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

  • book
    3d游戏开发相关书籍 c++数据结构算法 一个简单的射击游戏(3d game development books c++ data structure algorithms a simple shooting game)
    2015-06-07 20:28:59下载
    积分:1
  • bug
    一个基于C++的打虫子游戏,难度递增,虫子的轨迹随机。(A C++ to play insect games, difficulty increase.)
    2013-10-29 09:30:14下载
    积分:1
  • dhxy
    大话西游战斗模拟代码大话西游战斗模拟代码(Westward Journey combat simulation code)
    2012-05-30 12:29:52下载
    积分:1
  • tanke(1.2)
    全是用if then 走的坦克游戏.画面精彩.背景可移动(are used if the tank then take the game. Brilliant screen. Background Mobile)
    2006-11-13 20:27:20下载
    积分:1
  • Snake
    程序由C++编写,贪吃蛇程序,经运行无误,贪吃蛇长度无限制……(C++ written Snake program, run correctly, Snake length unlimited ...)
    2013-01-10 21:18:13下载
    积分:1
  • chenjie
    一个简单的龚 GDI 开发的一个小游戏,喜欢的大家分线一下。(无)
    2010-08-11 13:26:46下载
    积分:1
  • Pingtu
    说明:  Visual C++ 开发的拼图游戏,你可以下载下来学习,在vc6.0下能顺利运行(Visual C++ development jigsaw puzzle, you can download it and learn to run smoothly under the vc6.0)
    2011-03-05 13:26:44下载
    积分:1
  • SC2H
    Super easy game code, so you game Shuangwai
    2014-01-27 20:06:40下载
    积分:1
  • FIVE
    自己写的五子棋代码,可以直接执行,效率很高(Write your own backgammon code that can be executed directly, high efficiency)
    2013-10-10 10:56:31下载
    积分:1
  • snakegame
    贪吃蛇代码,snakegame.rar 希望有帮助。(Snake code, snakegame.rar want to help.)
    2012-08-22 01:22:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载