登录
首页 » Visual C++ » 2.3

2.3

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

  • 盛大传奇外挂原代码
    一个盛大传奇外挂原代码,可以编译执行的!好东东!(a grand legend external source, the implementation of the compiler! Wanton good!)
    2005-07-13 14:22:36下载
    积分:1
  • game
    vc++应用小游戏,利于初学者的学习。希望能够给大家带来一定的帮助。(game)
    2010-06-02 16:28:28下载
    积分:1
  • light
    3D游戏中关于灯光的编程的几个小例子,对灯光的理解很有帮助(the light program in 3D games)
    2009-06-15 09:59:55下载
    积分:1
  • 456767566
    飞机飞行游戏演示代码,1.界面美观大方 2.电脑智能下棋 3.有多种难度选择 4.内带黑白棋规则教程 5.电脑会有响应提示,与玩家进行互动 6.集娱乐性,智力多种元素于一身 ...查看 (jaoifsjgjsgjdgjjgjhgfr7i6dtui)
    2021-04-24 14:28:47下载
    积分:1
  • TanChiShe
    贪吃蛇经典小游戏,有效的帮助初学者进行开发学习,起到借鉴的作用!!!(Snake classic game, effective to help beginners to develop learning, play a reference role)
    2016-03-20 11:08:34下载
    积分:1
  • console
    说明:  象棋马的哈密顿回路算法代码,分治递归的方法。当m n<24时结果正确。这是重新上传,上一次工程中疏漏没有包含源码。(Hamilton horse chess circuit algorithm code, recursive partition method. When mn &lt 24 hours was correct. This is a re-upload, the last project oversight does not include source code.)
    2010-04-14 10:50:12下载
    积分:1
  • saolei
    扫雷小游戏,可供大学生学习c语言使用,此压缩包为源程序,各项功能有待完善。( Small game, can be used for college students to learn C language, for the initial source, the various functions to be improved. )
    2016-07-05 14:16:06下载
    积分:1
  • RunningMatchmen
    火柴人的跳跃和滚动 按s滚动躲避障碍 按w跳跃躲避障碍(Stickman jumping and rolling)
    2013-12-12 20:24:23下载
    积分:1
  • five_vb_tcp
    网络VB语言开发的五子棋,工作量是一周的本科毕业设计。(VB language network Gobang development, the workload is one-week graduate design.)
    2008-12-10 14:52:50下载
    积分:1
  • C1
    说明:  用c做的一个智力小游戏,能够够锻炼新学者的能力(C to do with an intellectual game can be enough to exercise the capacity of the new scholars)
    2009-09-01 08:25:45下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载