猜数字小游戏。游戏规则:随机产生4个数字,由玩家输入4个不重复的数字(如:8 3 1 2)按回车后电脑给出提示,其形式为"?A?B".你所输入的四位数中,位置和数字都正确则为A,数字相同但位置不相同时为B,你只可以猜10次,若你所用的次数小于纪录保持者,则为破纪录。
上传时间: 2013-12-29
上传用户:yiwen213
利用横向递归算法解决数据组合的问题, 比如数组为a, 长度为len, 横向递归 B display(a,len) b是二维数组,a是一维数组
上传时间: 2015-03-21
上传用户:tb_6877751
按递归下降方式设计其编译程序,生成PL/0栈式指令代码,然后解释执行。用(a=1)+2*(b=3+4*5)/2+2*a*b-(a=a+5)/ (c=2) 测试
上传时间: 2014-01-02
上传用户:firstbyte
一个比较简单的算法程序。输入一些数,计算后按照矩阵的形式输出。设了三个数组a[],b[],c[]。分别实现c[]=a[]+b[],c[]=a[]-b[],c[]=a[]*b[]。
上传时间: 2015-03-23
上传用户:qilin
UnZip is a small zipfile extract utility. It is written to be assmall portable as possible and is intended to be starting point for im-plementation of .ZIP files in non-IBM environments.Source code is provided in C and Turbo Pascal. If you port this programto a non-IBM system, I would appreciate a copy of the ported source andexe files.
标签: is portable possible extract
上传时间: 2014-01-20
上传用户:维子哥哥
本程序所求解的方程为x-cosx=0的解,程序将f(x)定义为子函数过程f(x),并把初值赋给相应变量后,即可使用xj(a,b,n)调用快带弦截法子函数。
上传时间: 2013-12-28
上传用户:星仔
银行家算法 银行家算法 银行家可以把一定数量的资金供多个用户周转使用,为保证资金的安全银行家规定: 1.当一个用户对资金的最大需求量不超过银行家现有的资金就要接纳该用户 2.用户可以分期贷款,但垡的总数不能超过最大需求量 3.当银行家现有的资金不能满足用户的沿需垡数时,对用户的贷款可推迟支付,但总能使用户在有限的时间里得到贷款 4当用户得到所需的全部资金后,一定能在有限的时间里归还所有的资金. 假设共有3类资源A B C,分别为10,5,7个 进程列表存在文件中,格式为 进程名 对A类资源需求数量 对B类资源需求数量 对c资源需求数量 输出每个进程的处理结果
上传时间: 2014-01-23
上传用户:liuchee
C++完美演绎 经典算法 如 /* 头文件:my_Include.h */ #include <stdio.h> /* 展开C语言的内建函数指令 */ #define PI 3.1415926 /* 宏常量,在稍后章节再详解 */ #define circle(radius) (PI*radius*radius) /* 宏函数,圆的面积 */ /* 将比较数值大小的函数写在自编include文件内 */ int show_big_or_small (int a,int b,int c) { int tmp if (a>b) { tmp = a a = b b = tmp } if (b>c) { tmp = b b = c c = tmp } if (a>b) { tmp = a a = b b = tmp } printf("由小至大排序之后的结果:%d %d %d\n", a, b, c) } 程序执行结果: 由小至大排序之后的结果:1 2 3 可将内建函数的include文件展开在自编的include文件中 圆圈的面积是=201.0619264
标签: my_Include include define 3.141
上传时间: 2014-01-17
上传用户:epson850
prolog 找路例子程序: === === === === === === Part 1-Adding connections Part 2-Simple Path example | ?- path1(a,b,P,T). will produce the response: T = 15 P = [a,b] ? Part 3 - Non-repeating path As an example, the query: ?- path2(a,h,P,T). will succeed and may produce the bindings: P = [a,depot,b,d,e,f,h] T = 155 Part 4 - Generating a path below a cost threshold As an example, the query: ?- path_below_cost(a,[a,b,c,d,e,f,g,h],RS,300). returns: RS = [a,b,depot,c,d,e,g,f,h] ? RS = [a,c,depot,b,d,e,g,f,h] ? no ==================================
标签: Part connections example prolog
上传时间: 2015-04-24
上传用户:ljt101007
网关模拟实验,输入ip,判断何a.b.c类网关。并加以修改。
上传时间: 2013-12-17
上传用户:thuyenvinh