河內塔問題 #include<stdio.h> #include<stdlib.h> int fun_a(int) void fun_b(int,int,int,int) int main(void) { int n int option printf("題目二:河內塔問題\n") printf("請輸入要搬移的圓盤數目\n") scanf("%d",&n) printf("最少搬移的次數為%d次\n",fun_a(n)) printf("是否顯示移動過程? 是請輸入1,否則輸入0\n") scanf("%d",&option) if(option==1) { fun_b(n,1,2,3) } system("pause") return 0 } int fun_a(int n) { int sum1=2,sum2=0,i for(i=n i>1 i--) { sum1=sum1*2 } sum2=sum1-1 return sum2 } void fun_b(int n,int left,int mid,int right) { if(n==1) printf("把第%d個盤子從第%d座塔移動到第%d座塔\n",n,left,right) else { fun_b(n-1,left,right,mid) printf("把第%d個盤子從第%d座塔移動到第%d座塔\n",n,left,right) fun_b(n-1,mid,left,right) } }
上傳時間: 2016-12-08
上傳用戶:努力努力再努力
幫助系統工程師,設計者,管理者在電視廣播上可以順利的傳輸類比訊號至數位訊號之基礎技術
上傳時間: 2014-01-07
上傳用戶:lht618
Boost C++ Libraries Free peer-reviewed portable C++ source libraries Boost C++ Libraries 基本上是一個免費的 C++ 的跨平臺函式庫集合,基本上應該可以把它視為 C++ STL 的功能再延伸;他最大的特色在於他是一個經過「同行評審」(peer review,可參考維基百科)、開放原始碼的函式庫,而且有許多 Boost 的函式庫是由 C++ 標準委員會的人開發的,同時部分函式庫的功能也已經成為 C++ TR1 (Technical Report 1,參考維基百科)、TR2、或是 C++ 0x 的標準了。 它的官方網站是:http://www.boost.org/,包含了 104 個不同的 library;由於他提供的函式庫非常地多,的內容也非常地多元,根據官方的分類,大致上可以分為下面這二十類: 字串和文字處理(String and text processing) 容器(Containers) Iterators 演算法(Algorithms) Function objects and higher-order programming 泛型(Generic Programming) Template Metaprogramming Preprocessor Metaprogramming Concurrent Programming 數學與數字(Math and numerics) 正確性與測試(Correctness and testing) 資料結構(Data structures) 影像處理(Image processing) 輸入、輸出(Input/Output) Inter-language support 記憶體(Memory) 語法分析(Parsing) 程式介面(Programming Interfaces) 其他雜項 Broken compiler workarounds 其中每一個分類,又都包含了一個或多個函式庫,可以說是功能相當豐富。
上傳時間: 2015-05-15
上傳用戶:fangfeng
智能SD卡座規範,智能SD卡又名SIMT卡、NFC TF卡、NFC Micro SD卡,可應用于近場通訊,移動支付領域,目前由銀聯主導推行
標簽: SD卡
上傳時間: 2013-07-17
上傳用戶:515414293
NNS-701 是專為移動裝置設計的全功能NFC (Near Field Communication)控制器芯片。
上傳時間: 2013-10-11
上傳用戶:蠢蠢66
32BIT加法器,輸入2個數字就可以跑出2個數字的合
上傳時間: 2015-08-09
上傳用戶:妄想演繹師
使用 RS232串列通訊和機器人連結,並且給予Output指令去使Robot去移動
上傳時間: 2014-01-11
上傳用戶:qq1604324866
This application report describes the use of Timer_A3 to decode RC5 and SIRC TV IR remote control signals. The decoder described in this report is interrupt-driven and operates a background function using specific features the Timer_A3. Only a small portion of the MSP430 CPU?s nonreal-time resources is used. Specific hardware bit-latching capabilities of the Timer_A3 module are used for real-time decoding of the IR data signal, independent and asynchronous to the CPU. CPU activity and power consumption are kept to an absolute minimum level. The Timer_A3 decoder implementation also allows other tasks to occur simultaneously if required. The solutions provided are written specifically for MSP430x11x(1) and MSP430x12x derivatives, but can be adapted to any other MSP430 incorporating Timer_A3. 電視遙控器設計基於MSP430
標簽: application describes Timer_A control
上傳時間: 2014-01-01
上傳用戶:qq21508895
s1.c是server,c.c是client, server負責接收client傳的數字進行運算並回傳,運用了同步的機制。編譯須加 -lsocket -lpthread -lrt
標簽: server
上傳時間: 2014-01-02
上傳用戶:athjac
根據bluelab3.5.2實例hid-keyboard做出應用,能發出數字鍵1-5
標簽: hid-keyboard bluelab
上傳時間: 2013-12-24
上傳用戶:牧羊人8920