登录
首页 » Visual C++ » 2.3

2.3

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

  • wzq
    用c语言写的五子棋游戏,用 了人工智能的,算法很好的。(us c)
    2010-05-18 23:09:07下载
    积分:1
  • qizhuanPP
    棋壮++(中国象棋UCCI引擎)源程序是基于UCCI协议开发的中国象棋程序引擎,可加载于象棋旋风、弈天、兵河等象棋界面。(Chess the strong++ (Chinese chess the UCCI engine that) source is based on Chinese chess program UCCI protocol development engine, can be loaded in xuanfeng, yitian Binghe chess interface.)
    2013-01-08 13:18:38下载
    积分:1
  • Snake
    贪吃蛇入门版,带有注释,希望能有助于大家的进步与学习(Snake Starter Edition, with Notes, we hope to contribute to the progress and learning)
    2013-11-17 16:04:56下载
    积分:1
  • vc的一个小
    这只是一个小小的程序 可以输入资料并显示还可以设置字体 还有一个小小的猜明星游戏 是VC++语言写的(this only a small import procedures and show also can set font guess there are a little star game is written in Visual C)
    2005-01-18 18:15:42下载
    积分:1
  • wlwzq
    五子棋人机对战网络对战 五子棋人机对战网络对战 (331 man-machine players magic 331 man-machine players magic 331 magic man-machine players)
    2006-07-07 08:59:53下载
    积分:1
  • cHitChecker_src
    说明:  游戏的算法 碰撞检测 开发环境是VC 库DIRECTX8.1(games collision detection algorithm development environment for VC DIRECTX8.1)
    2006-02-14 18:13:35下载
    积分: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
  • fivesource
    五子棋源码 (Gobang game source)
    2020-06-26 12:40:01下载
    积分:1
  • stone_choice
    很小很经典的一个游戏——取石子,一次只允许取1到3的整数,最后取走石子的一方失败。(A small classic games- from stone, to allow only take a 1-3 integer, and finally took away the stones of one loser.)
    2008-12-26 15:22:54下载
    积分:1
  • m1_2010Mar13
    MAME的游戏音乐播放DLL原代码,MAME的游戏音乐播放DLL原代码(MAME game DLL source code music playerMAME game DLL source code music player)
    2010-07-10 23:21:18下载
    积分:1
  • 696518资源总数
  • 105483会员总数
  • 22今日下载