-
1) Write a function reverse(A) which takes a matrix A of arbitrary dimensions as input and returns a matrix B consisting of the columns of A in reverse order. Thus for example, if
A = 1 2 3 then B = 3 2 1
4 5 6 6 5 4
7 8 9 9 8 7
Write a main program to call reverse(A) for the matrix A = magic(5). Print to the screen both A and reverse(A).
2) Write a program which accepts an input k from the keyboard, and which prints out the smallest fibonacci number that is at least as large as k. The program should also print out its position in the fibonacci sequence. Here is a sample of input and output:
Enter k>0: 100
144 is the smallest fibonacci number greater than or equal to 100.
It is the 12th fibonacci number.
標(biāo)簽:
dimensions
arbitrary
function
reverse
上傳時(shí)間:
2016-04-16
上傳用戶(hù):waitingfy
-
1.有三根桿子A,B,C。A桿上有若干碟子
2.每次移動(dòng)一塊碟子,小的只能疊在大的上面
3.把所有碟子從A桿全部移到C桿上
經(jīng)過(guò)研究發(fā)現(xiàn),漢諾塔的破解很簡(jiǎn)單,就是按照移動(dòng)規(guī)則向一個(gè)方向移動(dòng)金片:
如3階漢諾塔的移動(dòng):A→C,A→B,C→B,A→C,B→A,B→C,A→C
此外,漢諾塔問(wèn)題也是程序設(shè)計(jì)中的經(jīng)典遞歸問(wèn)題
標(biāo)簽:
移動(dòng)
發(fā)現(xiàn)
上傳時(shí)間:
2016-07-25
上傳用戶(hù):gxrui1991
-
1. 下列說(shuō)法正確的是 ( )
A. Java語(yǔ)言不區(qū)分大小寫(xiě)
B. Java程序以類(lèi)為基本單位
C. JVM為Java虛擬機(jī)JVM的英文縮寫(xiě)
D. 運(yùn)行Java程序需要先安裝JDK
2. 下列說(shuō)法中錯(cuò)誤的是 ( )
A. Java語(yǔ)言是編譯執(zhí)行的
B. Java中使用了多進(jìn)程技術(shù)
C. Java的單行注視以//開(kāi)頭
D. Java語(yǔ)言具有很高的安全性
3. 下面不屬于Java語(yǔ)言特點(diǎn)的一項(xiàng)是( )
A. 安全性
B. 分布式
C. 移植性
D. 編譯執(zhí)行
4. 下列語(yǔ)句中,正確的項(xiàng)是 ( )
A . int $e,a,b=10
B. char c,d=’a’
C. float e=0.0d
D. double c=0.0f
標(biāo)簽:
Java
A.
B.
C.
上傳時(shí)間:
2017-01-04
上傳用戶(hù):netwolf
-
This routine calls the glpk library to solve a LP/MIP problem. A typical
LP problem has following structure:
[min|max] C x
s.t.
Ax ["="|"<="|">="] b
{x <= UB}
{x >= LB}
The calling syntax is:
[XMIN,FMIN,STATUS,EXTRA]=glpkmex(SENSE,C,A,B,CTYPE,LB,UB,... VARTYPE,PARAM,LPSOLVER,SAVE)
標(biāo)簽:
problem
following
routine
library
上傳時(shí)間:
2014-12-01
上傳用戶(hù):changeboy
-
特點(diǎn)(FEATURES) 精確度0.1%滿(mǎn)刻度 (Accuracy 0.1%F.S.) 可作各式數(shù)學(xué)演算式功能如:A+B/A-B/AxB/A/B/A&B(Hi or Lo)/|A| (Math functioA+B/A-B/AxB/A/B/A&B(Hi&Lo)/|A|/etc.....) 16 BIT 類(lèi)比輸出功能(16 bit DAC isolating analog output function) 輸入/輸出1/輸出2絕緣耐壓2仟伏特/1分鐘(Dielectric strength 2KVac/1min. (input/output1/output2/power)) 寬范圍交直流兩用電源設(shè)計(jì)(Wide input range for auxiliary power) 尺寸小,穩(wěn)定性高(Dimension small and High stability)
標(biāo)簽:
微電腦
數(shù)學(xué)演算
輸出
隔離傳送器
上傳時(shí)間:
2013-11-24
上傳用戶(hù):541657925
-
TLC2543是TI公司的12位串行模數(shù)轉(zhuǎn)換器,使用開(kāi)關(guān)電容逐次逼近技術(shù)完成A/D轉(zhuǎn)換過(guò)程。由于是串行輸入結(jié)構(gòu),能夠節(jié)省51系列單片機(jī)I/O資源;且價(jià)格適中,分辨率較高,因此在儀器儀表中有較為廣泛的應(yīng)用。
TLC2543的特點(diǎn)
(1)12位分辯率A/D轉(zhuǎn)換器;
(2)在工作溫度范圍內(nèi)10μs轉(zhuǎn)換時(shí)間;
(3)11個(gè)模擬輸入通道;
(4)3路內(nèi)置自測(cè)試方式;
(5)采樣率為66kbps;
(6)線(xiàn)性誤差±1LSBmax;
(7)有轉(zhuǎn)換結(jié)束輸出EOC;
(8)具有單、雙極性輸出;
(9)可編程的MSB或LSB前導(dǎo);
(10)可編程輸出數(shù)據(jù)長(zhǎng)度。
TLC2543的引腳排列及說(shuō)明
TLC2543有兩種封裝形式:DB、DW或N封裝以及FN封裝,這兩種封裝的引腳排列如圖1,引腳說(shuō)明見(jiàn)表1
TLC2543電路圖和程序欣賞
#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
sbit clock=P1^0; sbit d_in=P1^1;
sbit d_out=P1^2;
sbit _cs=P1^3;
uchar a1,b1,c1,d1;
float sum,sum1;
double sum_final1;
double sum_final;
uchar duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar wei[]={0xf7,0xfb,0xfd,0xfe};
void delay(unsigned char b) //50us
{
unsigned char a;
for(;b>0;b--)
for(a=22;a>0;a--);
}
void display(uchar a,uchar b,uchar c,uchar d)
{
P0=duan[a]|0x80;
P2=wei[0];
delay(5);
P2=0xff;
P0=duan[b];
P2=wei[1];
delay(5);
P2=0xff;
P0=duan[c];
P2=wei[2];
delay(5);
P2=0xff;
P0=duan[d];
P2=wei[3];
delay(5);
P2=0xff;
}
uint read(uchar port)
{
uchar i,al=0,ah=0;
unsigned long ad;
clock=0;
_cs=0;
port<<=4;
for(i=0;i<4;i++)
{
d_in=port&0x80;
clock=1;
clock=0;
port<<=1;
}
d_in=0;
for(i=0;i<8;i++)
{
clock=1;
clock=0;
}
_cs=1;
delay(5);
_cs=0;
for(i=0;i<4;i++)
{
clock=1;
ah<<=1;
if(d_out)ah|=0x01;
clock=0;
}
for(i=0;i<8;i++)
{
clock=1;
al<<=1;
if(d_out) al|=0x01;
clock=0;
}
_cs=1;
ad=(uint)ah;
ad<<=8;
ad|=al;
return(ad);
}
void main()
{
uchar j;
sum=0;sum1=0;
sum_final=0;
sum_final1=0;
while(1)
{
for(j=0;j<128;j++)
{
sum1+=read(1);
display(a1,b1,c1,d1);
}
sum=sum1/128;
sum1=0;
sum_final1=(sum/4095)*5;
sum_final=sum_final1*1000;
a1=(int)sum_final/1000;
b1=(int)sum_final%1000/100;
c1=(int)sum_final%1000%100/10;
d1=(int)sum_final%10;
display(a1,b1,c1,d1);
}
}
標(biāo)簽:
2543
TLC
上傳時(shí)間:
2013-11-19
上傳用戶(hù):shen1230
-
摘 要:用一種新的思路和方法,先計(jì)算低通、再計(jì)算高通濾波器的有關(guān)參數(shù),然后組合成帶通濾波器.關(guān)鍵詞:濾波器;參數(shù);新思路中圖分類(lèi)號(hào): TN713. 5 文獻(xiàn)識(shí)別碼:B 文章編號(hào):1008 - 1666 (1999) 04 - 0089 - 03A New Consideration of the Band Filter’s CalculationGuo Wencheng( S hao Yang B usiness and Technology school , S haoyang , Hunan ,422000 )Abstract :This essay deals with a new method of calculating the band filters - first calculatingthe relevant parameters of low - pass filters ,then calculating the ones of high - pass filters.Key words :filter ; parameters ;new considercation八十年代后,信息產(chǎn)業(yè)得到了迅猛發(fā)展. 帶通濾波器在微波通信、廣播電視和精密儀器設(shè)備中得到了廣泛應(yīng)用. 帶通濾波器性能的優(yōu)劣,對(duì)提高接收機(jī)信噪比,防止鄰近信道干擾,提高設(shè)備的技術(shù)指標(biāo),有著十分重要的意義.我在長(zhǎng)期的教學(xué)實(shí)踐中,用切比雪夫型方法設(shè)計(jì)、計(jì)算出寬帶濾波器集中參數(shù)元件的數(shù)據(jù). 該濾波器可運(yùn)用在檢測(cè)微波頻率的儀器和其他設(shè)備中. 再將其思路和計(jì)算方法介紹給大家,供參考.
標(biāo)簽:
帶通濾波器設(shè)計(jì)
計(jì)算
上傳時(shí)間:
2014-12-28
上傳用戶(hù):Yukiseop
-
JAVA課程設(shè)計(jì)實(shí)例。多個(gè)大型系統(tǒng)源代碼,如考試系統(tǒng)單機(jī)版、C\S版、B\S版。
標(biāo)簽:
JAVA
設(shè)計(jì)實(shí)例
大型
上傳時(shí)間:
2014-01-20
上傳用戶(hù):zuozuo1215
-
RSA算法 :首先, 找出三個(gè)數(shù), p, q, r, 其中 p, q 是兩個(gè)相異的質(zhì)數(shù), r 是與 (p-1)(q-1) 互質(zhì)的數(shù)...... p, q, r 這三個(gè)數(shù)便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 這個(gè) m 一定存在, 因?yàn)?r 與 (p-1)(q-1) 互質(zhì), 用輾轉(zhuǎn)相除法就可以得到了..... 再來(lái), 計(jì)算 n = pq....... m, n 這兩個(gè)數(shù)便是 public_key ,編碼過(guò)程是, 若資料為 a, 將其看成是一個(gè)大整數(shù), 假設(shè) a < n.... 如果 a >= n 的話(huà), 就將 a 表成 s 進(jìn)位 (s
標(biāo)簽:
person_key
RSA
算法
上傳時(shí)間:
2013-12-14
上傳用戶(hù):zhuyibin
-
《大型數(shù)據(jù)庫(kù)技術(shù):Oracle 9i高級(jí)程序設(shè)計(jì)教程》隨書(shū)光盤(pán)。
本書(shū)結(jié)合大量的實(shí)例,介紹如何利用Oracle來(lái)管理和維護(hù)數(shù)據(jù),以及使用JSP、PHP和C#開(kāi)發(fā)C/S模式和B/S模式網(wǎng)絡(luò)數(shù)據(jù)庫(kù)應(yīng)用程序。全書(shū)分為管理篇、開(kāi)發(fā)篇和實(shí)踐篇3個(gè)部分。管理篇和開(kāi)發(fā)篇Oracle數(shù)據(jù)庫(kù)的管理和開(kāi)發(fā)技術(shù);實(shí)踐篇完整地介紹使用JSP、PHP和C#開(kāi)發(fā)的基于Oracle數(shù)據(jù)庫(kù)項(xiàng)目的實(shí)例。這些實(shí)例既可以作為獨(dú)立的系統(tǒng)運(yùn)行,也可以取其中的一部分作為應(yīng)用軟件的一個(gè)模塊,具有很強(qiáng)的實(shí)用性。本書(shū)所附光盤(pán)內(nèi)容為本書(shū)的所涉及的源代碼。
本書(shū)適合Oracle數(shù)據(jù)庫(kù)管理員和應(yīng)用程序開(kāi)發(fā)人員,以及對(duì)數(shù)據(jù)庫(kù)技術(shù)感興趣的讀者閱讀。
標(biāo)簽:
Oracle
大型
光盤(pán)
數(shù)據(jù)庫(kù)技術(shù)
上傳時(shí)間:
2015-05-06
上傳用戶(hù):xmsmh