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.
對于給定的一組進程,采用優先級加時間片輪轉法進行調度。設有一個就緒隊列,就緒進程按優先數(優先數范圍0-100)由小到大排列(優先數越小,級別越高)。當某一進程運行完一個時間片后,其優先級應下調(如優先數加3),試對如下給定的一組進程給出其調度順序。每當結束一進程時要給出當前系統的狀態(即顯示就緒隊列)。這里,進程可用進程控制塊(PCB)表示為如右表所示。
進程名 A B C D E F G H J K L M
到達時間 0 1 2 3 6 8 12 12 12 18 25 25
服務時間 6 4 10 5 1 2 5 10 4 3 15 8
工業領域串口通信速度慢是個比較突出的問題, 而 F T 2 4 5 B M 能夠進行 US B和并行 I / O口之間的
協議轉換, 在一些條件下能夠取代串口. 介紹 F T 2 4 5 B M 芯片的工作原理和功能, 并給出基于 F T2 4 5 B M 的
US B接口電路的應用設計和基于 8 9 c 5 2的匯編及 c 5 1 單片機源程序.