河內塔問題 #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
上傳用戶:努力努力再努力
本代碼包為本人的一篇文章<一個占用內存極少的菜單系統的實現>在在PC上的測試移植代碼。 ------------------------------ Menu_Src目錄為Menu的源代碼 Ks0108.C的void Display_Locate(unsigned char DisplayData, unsigned char X, unsigned char Y)函數為最底層的顯示函數。 該函數調用LCD模擬函數來完成顯示。 KeyScan.C的unsigned char KeyScan(void)函數為鍵盤模擬函數。 void DelayMs( WORD time ) 延時 ------------------------------ GUI_SIM.exe為編譯后的文件,可以直觀看到這個GUI的效果. PC鍵盤的4個按鍵控制菜單周轉: PC按鍵 菜單中功能 up 向上鍵 確定鍵 進入子菜單 down向下鍵 取消鍵 返回父菜單 left向左鍵 向上鍵 菜單項上一項 RIGHT向右鍵 向下鍵 菜單項下一項 有興趣自己編譯VC工程:\Project\Menu.dsw <一個占用內存極少的菜單系統的實現>相關PDF文檔和其他資料在以下鏈接: http://www.ouravr.com/bbs/bbs_content.jsp?bbs_sn=798580&bbs_page_no=3&bbs_id=9999
上傳時間: 2014-06-24
上傳用戶:stvnash
Computes approximate significance points of a Pearson curve with given first four moments, or first three moments and left or RIGHT boundary
標簽: first significance approximate Computes
上傳時間: 2014-06-29
上傳用戶:silenthink
輔助說明: 代碼交流 QQ59771230 email:choudaxian@163.com 注意事項: 1) LCD 指令中的TEXT GRAPHIC AREA SET效果是什么樣的 2) LCD 指令中的MODE SET中的OR AND XOR 有圖層的味道 3) DJNZ+指令C0H(DATA AND WRITE)與相同的數據時就會出錯 4) CHAR ADN PIC分別清除 5) 幾何圖形繪制與實現圖形 6) 菜單優化設計,結構體:上,下,上一組,下一組,指向函數的指針 顯示的內容: 16*16漢字:歡迎使用福萊特電氣有限公司產品 12*12漢字:進入主界面并且可以反顯 8*8字符:FULL-RIGHT 并對所顯示的漢字進行卷屏顯示 關鍵是如何方便在屏上確定的位置上顯示確定的漢字 要使占用ROM,RAM小的前提下
標簽: choudaxian 59771230 GRAPHIC email
上傳時間: 2016-12-28
上傳用戶:xauthu
//使用gray code的解法 #include <iostream> #include <cmath> using namespace std #define ZERO 0 #define ONE 1 #define ODD 1 #define EVEN 0 #define RIGHT 1 #define LEFT 0 #define MAX 10
標簽: include namespace iostream define
上傳時間: 2016-12-31
上傳用戶:luke5347
FileEdit can edit file ,save file ,open file ,have basic simple functions for file .INSERT, BACKSPACE ,TAB,PGUP,PGDOWN,UP,DOWN,LEFT,RIGHT AND SO ON
標簽: file functions FileEdit BACKSPAC
上傳時間: 2017-01-02
上傳用戶:風之驕子
void Knight(int i , int j) { // printf("%d %dn",i,j) if (board[i][j] != 0 || i < 0 || i >= Size || j < 0 || j >= Size ) { return } step++ board[i][j]=step if (step == Size*Size) { showboard() system("PAUSE") return } //DFS Knight(i-2,j-1) //left Knight(i-2,j+1) Knight(i+2,j-1) //RIGHT Knight(i+2,j+1) Knight(i-1,j-2) //up Knight(i+1,j-2) Knight(i+1,j+2) //down Knight(i-1,j+2) // board[i][j]=0 step-- }
上傳時間: 2014-01-17
上傳用戶:cxl274287265
業務管理:包括客房預訂、入住登記、續住、換房、轉賬、其他服務提供、留言板、意見簿、走客結賬、欠費結算。 ¯ 查詢統計:包括歷史單據、預訂表、在住客人表、換房查詢、轉賬查詢、日經營狀況、月收入狀況、客房利用率、實時房態。-system design focus of this chapter describe the development of small PowerBuilder 9.0 Rooms Management System process, through the study of this chapter, readers should be familiar with PowerBuilder 9.0 TreeView control and the RIGHT mouse button menu of use, master GroupBox, SingleLineEdit, CommandButton, RadioButton, PictureButton controls such as the similarities and differences to further understanding of data objects window displays various occasions the application. System to complete the task Macr system maintenance include : corporate information, the operator management, change passwords, management succession, dictionary management. Macr basic information : Rooms management system for the basic information management (including new, modify or delete), which is the basic informat
上傳時間: 2017-02-09
上傳用戶:songyue1991
業務管理:包括客房預訂、入住登記、續住、換房、轉賬、其他服務提供、留言板、意見簿、走客結賬、欠費結算。 ¯ 查詢統計:包括歷史單據、預訂表、在住客人表、換房查詢、轉賬查詢、日經營狀況、月收入狀況、客房利用率、實時房態。-system design focus of this chapter describe the development of small PowerBuilder 9.0 Rooms Management System process, through the study of this chapter, readers should be familiar with PowerBuilder 9.0 TreeView control and the RIGHT mouse button menu of use, master GroupBox, SingleLineEdit, CommandButton, RadioButton, PictureButton controls such as the similarities and differences to further understanding of data objects window displays various occasions the application. System to complete the task Macr system maintenance include : corporate information, the operator management, change passwords, management succession, dictionary management. Macr basic information : Rooms management system for the basic information management (including new, modify or delete), which is the basic informat
上傳時間: 2013-12-05
上傳用戶:開懷常笑
業務管理:包括客房預訂、入住登記、續住、換房、轉賬、其他服務提供、留言板、意見簿、走客結賬、欠費結算。 ¯ 查詢統計:包括歷史單據、預訂表、在住客人表、換房查詢、轉賬查詢、日經營狀況、月收入狀況、客房利用率、實時房態。-system design focus of this chapter describe the development of small PowerBuilder 9.0 Rooms Management System process, through the study of this chapter, readers should be familiar with PowerBuilder 9.0 TreeView control and the RIGHT mouse button menu of use, master GroupBox, SingleLineEdit, CommandButton, RadioButton, PictureButton controls such as the similarities and differences to further understanding of data objects window displays various occasions the application. System to complete the task Macr system maintenance include : corporate information, the operator management, change passwords, management succession, dictionary management. Macr basic information : Rooms management system for the basic information management (including new, modify or delete), which is the basic informat
上傳時間: 2013-12-20
上傳用戶:ouyangtongze