冒泡法是數據排序的一種基本算法,它的基本方法是:相鄰兩元素進行比較,如有需要則進行交換, 每完成一次循環就將最小元素排在最后(如從大到小排序),下一次循環是將其他的數進行類似操作? 如將N 個數按從大到小排序,Turbo C語言程序函數
上傳時間: 2016-03-20
上傳用戶:趙云興
Intro/: Directory containing introductory examples. HelloWorld.c A simple program that draws a box and writes "Hello World" in HelloWorld.f it. data The data file for the introductory progressive example. Lines.c Reads the data from file "data" and plots just the curve with Lines.f no labels, viewport or anything indicating quantity or units. Viewport.c Restricts the graph to a viewport and frames the viewport, Viewport.f leaving the remainder of the area for labels, etc. CharLbls.c Adds labels for the chart title, X-axis title, and Y-axis CharLbls.f title. Tics.c Adds tic marks to the viewport edges, but since clipping was Tics.f not set correctly, tics extend outside the viewport. Clip.c Sets clipping such that tic marks are clipped at the viewport Clip.f boundaries. TicLabels.c Adds numeric tic labels to the graph this is the final TicLabels.f installment of the progressive example.
標簽: introductory HelloWorld containing Directory
上傳時間: 2016-03-29
上傳用戶:exxxds
Problem F:汽車加油 Time Limit:1000MS Memory Limit:65536K Total Submit:1400 Accepted:404 Language: not limited Description 一輛汽車加滿油后可行駛n公里。旅途中有若干個加油站。設計一個有效算法,指出應在哪些加油站停靠加油,使沿途加油次數最少。 編程任務: 對于給定的n和k(k <= 10000)個加油站位置,編程計算最少加油次數。 Input 第一行有2 個正整數n和k,表示汽車加滿油后可行駛n公里,且旅途中有k個加油站。接下來的1 行中,有k+1 個整數,表示第k個加油站與第 k-1 個加油站之間的距離。第0 個加油站表示出發地,汽車已加滿油。第k+1 個加油站表示目的地。 Output 輸出最少加油次數。如果無法到達目的地,則輸出”No Solution”。 Sample Input 7 7 1 2 3 4 5 1 6 6 Sample Output 4
標簽: Limit Accepted Language Problem
上傳時間: 2016-04-12
上傳用戶:youth25
編程題(15_01.c) 結構 struct student { long num char name[20] int score struct student *next } 鏈表練習: (1).編寫函數struct student * creat(int n),創建一個按學號升序排列的新鏈表,每個鏈表中的結點中 的學號、成績由鍵盤輸入,一共n個節點。 (2).編寫函數void print(struct student *head),輸出鏈表,格式每行一個結點,包括學號,姓名,分數。 (3).編寫函數struct student * merge(struct student *a,struct student *b), 將已知的a,b兩個鏈表 按學號升序合并,若學號相同則保留成績高的結點。 (4).編寫函數struct student * del(struct student *a,struct student *b),從a鏈表中刪除b鏈表中有 相同學號的那些結點。 (5).編寫main函數,調用函數creat建立2個鏈表a,b,用print輸出倆個鏈表;調用函數merge升序合并2個 鏈表,并輸出結果;調用函數del實現a-b,并輸出結果。 a: 20304,xxxx,75, 20311,yyyy,89 20303,zzzz,62 20307,aaaa,87 20320,bbbb,79 b: 20302,dddd,65 20301,cccc,99 20311,yyyy,87 20323,kkkk,88 20307,aaaa,92 20322,pppp,83
上傳時間: 2016-04-13
上傳用戶:zxc23456789
解決N皇后問題,使用的是C++編寫的,有興趣的可以
標簽:
上傳時間: 2016-04-20
上傳用戶:wang5829
回溯算法解決n皇后問題,c++源碼,可以參考
標簽: 回溯算法
上傳時間: 2016-05-04
上傳用戶:牛津鞋
高質量C++/C編程指南軟件質量是被大多數程序員掛在嘴上而不是放在心上的東西! 除了完全外行和真正的編程高手外,初讀本書,你最先的感受將是驚慌:“哇!我以前捏造的C++/C程序怎么會有那么多的毛???” 別難過,作者只不過比你早幾年、多幾次驚慌而已。 請花一兩個小時認真閱讀這本百頁經書,你將會獲益匪淺,這是前面N-1個讀者的建議。
上傳時間: 2016-05-24
上傳用戶:shinesyh
{ OCSP REQUEST*req=NULL if ((req=OCSP一 REQUEST new())一NULL) goto err if (name) /* optional*/ f if (!(req->tbsRequest->requestorName=GENERAL-NAME_ new())) goto er req->tbsRequest->requestorName->type=GEN一 DIRNAME req->tbsRequest->requestorName->d.dim=X509一 NAM幾dup(name) } if(!(req->tbsRequest->requestList=sk-OCSP ONEREQ_new(N〔幾L))) goto er if(extensions && (!(req->tbsRequest->requestExtensions = ext dup(extensions)))) goto er return req if (req) OCSP REQUEST free(req) return NULL ) 刀此函數用于一個新的合法的OCSP請求加入列表中
上傳時間: 2014-01-17
上傳用戶:lanjisu111
!逐步回歸分析程序: ! M:輸入變量,M=N+1,其中N為自變量的個數;M包括的因變量個數 ! K:輸入變量,觀測點數; ! F1:引入因子時顯著性的F-分布值; ! F2:剔除因子時顯著性的F-分布值; ! XX:存放自變量和因變量的平均值; ! B:存放回歸系數; ! V:存放偏回歸平方和和殘差平方和Q; ! S:存放回歸系數的標準偏差和估計的標準偏差; ! C:存放復相關系數; ! F:存放F-檢驗值;
上傳時間: 2013-12-12
上傳用戶:zaizaibang
設定a為N(0,1)的500個隨機數和i長為500,以n=8、16、64.分別調用u_pcm.m ,從中計算量化誤差f=a-a_quan并繪圖,分別輸出各樣值的量化誤差圖形。
上傳時間: 2014-01-17
上傳用戶:偷心的海盜