prolog 找路例子程序: === === === === === === Part 1-Adding connections Part 2-Simple Path example | ?- path1(a,b,P,T). will produce the response: T = 15 P = [a,b] ? Part 3 - Non-repeating path As an example, the query: ?- path2(a,h,P,T). will succeed and may produce the bindings: P = [a,depot,b,d,e,f,h] T = 155 Part 4 - Generating a path below a cost threshold As an example, the query: ?- path_below_cost(a,[a,b,c,d,e,f,g,h],RS,300). returns: RS = [a,b,depot,c,d,e,g,f,h] ? RS = [a,c,depot,b,d,e,g,f,h] ? no ==================================
標簽: Part connections example prolog
上傳時間: 2015-04-24
上傳用戶:ljt101007
裝備盒問題。 大意是給出一個矩形地板,你有一個底面為矩形的盒子必須放在上面而不超過地板邊界。 現在給出地板的長(X)和寬(Y),以及盒子的長(a)和寬(b),問是否可能達到要求(即放上去不超過邊界)
標簽: 矩形
上傳時間: 2015-04-28
上傳用戶:gundamwzc
5 ledblink -- 跑馬燈程序 該項目在SDT2.51下編譯調試。最簡單的demo程序,運行后3個發光二極管輪流點亮。 6 timerint -- 定時器中斷demo程序 該項目在SDT2.51下編譯調試。將子目錄timerint拷貝到c:\ 下。 該demo程序的主程序是while空循環,定時器中斷服務程序每500ms將3個LED反相。 在57600超級終端里也可以看到中斷發生時的信息。 7 uart -- 串口測試程序 該項目在SDT2.51下編譯調試。運行后在57600的超級終端里等待PC鍵盤的輸入,當按下 a 或 b 或 c 按鍵時,超級終端里將顯示 You Pressed a ,You Pressed b ,You Pressed c .
上傳時間: 2015-05-05
上傳用戶:aix008
二分圖是一個無向圖,它的n 個頂點可二分為集合A和集合B,且同一集合中的任意兩個頂點在圖中無邊相連(即任何一條邊都是一個頂點在集合A中,另一個在集合B中)。當且僅當B中的每個頂點至少與A中一個頂點相連時,A的一個子集A 覆蓋集合B(或簡單地說,A 是一個覆蓋)。覆蓋A 的大小即為A 中的頂點數目。當且僅當A 是覆蓋B的子集中最小的時,A 為最小覆蓋。
上傳時間: 2015-05-07
上傳用戶:alan-ee
十部經典算法合集 .chm Fundamentals of Data Structures by Ellis Horowitz and Sartaj Sahni PREFACE CHAPTER 1: INTRODUCTION CHAPTER 2: ARRAYS CHAPTER 3: STACKS AND QUEUES CHAPTER 4: LINKED LISTS CHAPTER 5: TREES CHAPTER 6: GRAPHS CHAPTER 7: INTERNAL SORTING CHAPTER 8: EXTERNAL SORTING CHAPTER 9: SYMBOL TABLES CHAPTER 10: FILES APPENDIX A: SPARKS APPENDIX B: ETHICAL CODE IN INFORMATION PROCESSING APPENDIX C: ALGORITHM INDEX BY CHAPTER
標簽: Fundamentals Structures Horowitz PREFACE
上傳時間: 2015-05-19
上傳用戶:維子哥哥
數字運算,判斷一個數是否接近素數 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
MFC Black Book Introduction: Are you an MFC programmer? Good. There are two types of MFC programmers. What kind are you? The first kind are the good programmers who write programs that conform to the way MFC wants you to do things. The second bunch are wild-eyed anarchists who insist on getting things done their way. Me, I’m in the second group. If you are in the same boat (or would like to be) this book is for you. This book won’t teach you MFC—not in the traditional sense. You should pick it up with a good understanding of basic MFC programming and a desire to do things differently. This isn’t a Scribble tutorial (although I will review some fundamentals in the first chapter). You will learn how to wring every drop from your MFC programs. You’ll discover how to use, abuse, and abandon the document/view architecture. If you’ve ever wanted custom archives, you’ll find that, too.
標簽: MFC Introduction programmer programme
上傳時間: 2015-05-30
上傳用戶:youke111
This a program to implement the so-called "dancing link" which is introduced in Knuth s paper. This is really a super acrobatic and I am sure that not many programmers can understand the algorithms.
標簽: This introduced implement so-called
上傳時間: 2013-12-11
上傳用戶:784533221
電力系統在臺穩定計算式電力系統不正常運行方式的一種計算。它的任務是已知電力系統某一正常運行狀態和受到某種擾動,計算電力系統所有發電機能否同步運行 1運行說明: 請輸入初始功率S0,形如a+bi 請輸入無限大系統母線電壓V0 請輸入系統等值電抗矩陣B 矩陣B有以下元素組成的行矩陣 1正常運行時的系統直軸等值電抗Xd 2故障運行時的系統直軸等值電抗X d 3故障切除后的系統直軸等值電抗 請輸入慣性時間常數Tj 請輸入時段數N 請輸入哪個時段發生故障Ni 請輸入每時段間隔的時間dt
上傳時間: 2015-06-13
上傳用戶:it男一枚
本文描述了TrackBack, 一個點對點通信和網站間互相通告的框架. TrackBack的中心思想是TrackBack ping的概念, 從本質上講,TrackBack ping是一個請求,通告“資源A與資源B相關,或有鏈接到資源B.” 一個TrackBack “資源” 用一個TrackBack Ping URL表示, 這是一個標準的URI.
上傳時間: 2013-12-12
上傳用戶:123456wh