虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

03.<b>05</b>

  • 1.有三根杆子A,B,C。A杆上有若干碟子 2.每次移动一块碟子,小的只能叠在大的上面 3.把所有碟子从A杆全部移到C杆上 经过研究发现

    1.有三根杆子A,B,C。A杆上有若干碟子 2.每次移动一块碟子,小的只能叠在大的上面 3.把所有碟子从A杆全部移到C杆上 经过研究发现,汉诺塔的破解很简单,就是按照移动规则向一个方向移动金片: 如3阶汉诺塔的移动:A→C,A→B,C→B,A→C,B→A,B→C,A→C 此外,汉诺塔问题也是程序设计中的经典递归问题

    标签: 移动 发现

    上传时间: 2016-07-25

    上传用户:gxrui1991

  • 1. 下列说法正确的是 ( ) A. Java语言不区分大小写 B. Java程序以类为基本单位 C. JVM为Java虚拟机JVM的英文缩写 D. 运行Java程序需要先安装JDK

    1. 下列说法正确的是 ( ) A. Java语言不区分大小写 B. Java程序以类为基本单位 C. JVM为Java虚拟机JVM的英文缩写 D. 运行Java程序需要先安装JDK 2. 下列说法中错误的是 ( ) A. Java语言是编译执行的 B. Java中使用了多进程技术 C. Java的单行注视以//开头 D. Java语言具有很高的安全性 3. 下面不属于Java语言特点的一项是( ) A. 安全性 B. 分布式 C. 移植性 D. 编译执行 4. 下列语句中,正确的项是 ( ) A . int $e,a,b=10 B. char c,d=’a’ C. float e=0.0d D. double c=0.0f

    标签: Java A. B. C.

    上传时间: 2017-01-04

    上传用户:netwolf

  • 智能家居的标准与协议

    家 庭 总 线 是 智 能 家 居 实 现 的 重 要 基 础 . 是 住 宅 内 部 的 神 经 系 统 . 其 主 要 作 用 是 连 接 家 中的各 种 电子 、 电气 设 备 . 负责 将 家 庭 内 的 各 种 通 信 设 备 ( 包 括 安 保 、 电话 、 家 电 、 视 听 设 备 等 )连 接 在 一 起 . 形 成 一 个 完 整 的家 庭 网 络 。 日 本 是 较 早 推 动 智 能 家 居 发 展 的 国 家 之 一 , 它 较 早 地 提 出 了 家庭 总线 系统 (H O m e B u S S Y S t e m , 简称H B S ) 的概念 . 成 立 了 家庭 总线 (H B S )研 究会 . 并 在 邮政省和 通 产 省 的指 导 下 组 成 了H B S 标 准委 员 会 , 制定 了 日 本 的H B s 标 准 。 按 照 该 标 准 , H B S 系统 由一 条 同 轴 电 缆 和 4 对 双 绞 线 构 成 , 前 者 用 于 传 输 图 像 信 息 . 后者 用 于 传输语 音 、 数据及 控制信 号 。 各 类家用 设 备 与 电气 设 备 均 按 一 定 方式 与H B S 相 连 , 这 些 电气设 备 既 可 以在 室 内进 行 控制 . 也 可 在异地 通 过 电话进行 遥 控 。 为适 应 大型 居住社 区 的需 要 , 1 9 8 8 年年初 , 日 本住 宅信息 化推进协会 又 推 出 了 超级 家庭总 线 (S u p e r H0 m e B u s S y s t e m , 简 称S - H B S ) , 它适 用 于 更 大 的范 围 . 因 为一 个S - H B s 系统可 挂接 数千个家庭 内部 网 。 家庭 智能化要 求诸 多家 电和 网络能够彼此 相容 . 总线协 议是 其精髓 所 在 , 只 有接 E l 畅通 , 家 电才能 “ 听懂 ” 人 发 出的指令 , 因此 总线标准 的物理 层 接 口 形 式 是 智能 家居 亟 待解决 的重 要 问题 之 一 。 目前 比 较成型 的总线标 准 协 议 主 要 是 美 国公 司 提 出 的 , 包 括E c h e l o n 公 司 I)~L o n W o r k s 协议 、 电子 工 业 协 会 (E I A ) 的C E 总线协 议 (C EB u S ) 、 S m a r t Ho u s e L P 的智 能屋 协 议 和×一 1 0 公 司 的X 一 1 0 协 议等。 这 些 协 议 各 有 优 劣 。

    标签: 智能家居

    上传时间: 2022-03-11

    上传用户:

  • RSA算法 :首先, 找出三个数, p, q, r, 其中 p, q 是两个相异的质数, r 是与 (p-1)(q-1) 互质的数...... p, q, r 这三个数便是 person_key

    RSA算法 :首先, 找出三个数, p, q, r, 其中 p, q 是两个相异的质数, r 是与 (p-1)(q-1) 互质的数...... p, q, r 这三个数便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 这个 m 一定存在, 因为 r 与 (p-1)(q-1) 互质, 用辗转相除法就可以得到了..... 再来, 计算 n = pq....... m, n 这两个数便是 public_key ,编码过程是, 若资料为 a, 将其看成是一个大整数, 假设 a < n.... 如果 a >= n 的话, 就将 a 表成 s 进位 (s

    标签: person_key RSA 算法

    上传时间: 2013-12-14

    上传用户:zhuyibin

  • 数字运算

    数字运算,判断一个数是否接近素数 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no

    标签: 数字 运算

    上传时间: 2015-05-21

    上传用户:daguda

  • We have a group of N items (represented by integers from 1 to N), and we know that there is some tot

    We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.

    标签: represented integers group items

    上传时间: 2016-01-17

    上传用户:jeffery

  • 本代码为编码开关代码

    本代码为编码开关代码,编码开关也就是数字音响中的 360度旋转的数字音量以及显示器上用的(单键飞梭开 关)等类似鼠标滚轮的手动计数输入设备。 我使用的编码开关为5个引脚的,其中2个引脚为按下 转轮开关(也就相当于鼠标中键)。另外3个引脚用来 检测旋转方向以及旋转步数的检测端。引脚分别为a,b,c b接地a,c分别接到P2.0和P2.1口并分别接两个10K上拉 电阻,并且a,c需要分别对地接一个104的电容,否则 因为编码开关的触点抖动会引起轻微误动作。本程序不 使用定时器,不占用中断,不使用延时代码,并对每个 细分步数进行判断,避免一切误动作,性能超级稳定。 我使用的编码器是APLS的EC11B可以参照附件的时序图 编码器控制流水灯最能说明问题,下面是以一段流水 灯来演示。

    标签: 代码 编码开关

    上传时间: 2017-07-03

    上传用户:gaojiao1999

  • 道理特分解法

    #include "iostream" using namespace std; class Matrix { private: double** A; //矩阵A double *b; //向量b public: int size; Matrix(int ); ~Matrix(); friend double* Dooli(Matrix& ); void Input(); void Disp(); }; Matrix::Matrix(int x) { size=x; //为向量b分配空间并初始化为0 b=new double [x]; for(int j=0;j<x;j++) b[j]=0; //为向量A分配空间并初始化为0 A=new double* [x]; for(int i=0;i<x;i++) A[i]=new double [x]; for(int m=0;m<x;m++) for(int n=0;n<x;n++) A[m][n]=0; } Matrix::~Matrix() { cout<<"正在析构中~~~~"<<endl; delete b; for(int i=0;i<size;i++) delete A[i]; delete A; } void Matrix::Disp() { for(int i=0;i<size;i++) { for(int j=0;j<size;j++) cout<<A[i][j]<<" "; cout<<endl; } } void Matrix::Input() { cout<<"请输入A:"<<endl; for(int i=0;i<size;i++) for(int j=0;j<size;j++){ cout<<"第"<<i+1<<"行"<<"第"<<j+1<<"列:"<<endl; cin>>A[i][j]; } cout<<"请输入b:"<<endl; for(int j=0;j<size;j++){ cout<<"第"<<j+1<<"个:"<<endl; cin>>b[j]; } } double* Dooli(Matrix& A) { double *Xn=new double [A.size]; Matrix L(A.size),U(A.size); //分别求得U,L的第一行与第一列 for(int i=0;i<A.size;i++) U.A[0][i]=A.A[0][i]; for(int j=1;j<A.size;j++) L.A[j][0]=A.A[j][0]/U.A[0][0]; //分别求得U,L的第r行,第r列 double temp1=0,temp2=0; for(int r=1;r<A.size;r++){ //U for(int i=r;i<A.size;i++){ for(int k=0;k<r-1;k++) temp1=temp1+L.A[r][k]*U.A[k][i]; U.A[r][i]=A.A[r][i]-temp1; } //L for(int i=r+1;i<A.size;i++){ for(int k=0;k<r-1;k++) temp2=temp2+L.A[i][k]*U.A[k][r]; L.A[i][r]=(A.A[i][r]-temp2)/U.A[r][r]; } } cout<<"计算U得:"<<endl; U.Disp(); cout<<"计算L的:"<<endl; L.Disp(); double *Y=new double [A.size]; Y[0]=A.b[0]; for(int i=1;i<A.size;i++ ){ double temp3=0; for(int k=0;k<i-1;k++) temp3=temp3+L.A[i][k]*Y[k]; Y[i]=A.b[i]-temp3; } Xn[A.size-1]=Y[A.size-1]/U.A[A.size-1][A.size-1]; for(int i=A.size-1;i>=0;i--){ double temp4=0; for(int k=i+1;k<A.size;k++) temp4=temp4+U.A[i][k]*Xn[k]; Xn[i]=(Y[i]-temp4)/U.A[i][i]; } return Xn; } int main() { Matrix B(4); B.Input(); double *X; X=Dooli(B); cout<<"~~~~解得:"<<endl; for(int i=0;i<B.size;i++) cout<<"X["<<i<<"]:"<<X[i]<<" "; cout<<endl<<"呵呵呵呵呵"; return 0; } 

    标签: 道理特分解法

    上传时间: 2018-05-20

    上传用户:Aa123456789

  • STM32F407ZGT的Modbus RTU从站程序

    这个程序是基于STM32F4库函数编写的Modbus RTU程序,支持功能码01、02、03、05、06、15、16,RS485通讯,TX:PA2发送,RX:PA3接收,EN:PG8控制收发经测试,这些功能都可以应用,

    标签: STM32F407ZGT MODBUS RTU

    上传时间: 2022-05-14

    上传用户:

  • Raspberry Pi学习,树莓派镜像资料杂集

    树莓派入门套件A光盘.rar 2.87G2020-03-03 16:17 raspberry pi 3B+ 系统烧入及设置WIFI连接方法.rar 259.6M2020-03-03 16:17 C套餐资料.rar 573M2020-03-03 16:17 B套餐资料.rar 1.87G2020-03-03 16:17 raspbian-stretch.rar …………

    标签: 数字图像处理 电信

    上传时间: 2013-07-21

    上传用户:eeworm