原创 C++必備18個經典程序(1)

1.輸出9*9口訣,i控制行,j控制列 #include <iostream> using namespace std; int main() {     int i,j,result;for(i=1;i<10;i++){for(j=1;

原创 Linux與Windows共享(Samba的配置)

兩個前提1和2(必須通過,不然後面的步驟沒有意義) 1. 從Windows能夠ping通Linux 2. 關閉Linux防火牆 運行命令: /etc/init.d/iptables stop 共享方法1:(軟件winSCP下面給出下載地址

原创 MATLAB仿真畫100個隨機節點

ndot=100;  %畫100個點 xmin=0;   %x軸起點座標 xmax=100;   %x軸終點座標 ymin=0; ymax=100; x=rand(ndot,1)*(xmax-xmin)+xmin;   %隨機產生100個

原创 MATLAB中legend函數的用法

格式: legend(‘字符串1’,‘字符串2’...,參數) 其中,字符串根據畫圖的順序進行註釋。 參數爲以下數字: 0——自動放置在最佳位置 1——右上角 2——左上角 3——左下角 4——右下角 -1——圖形外面的右上角

原创 C++必備18個經典程序(2)

10、/*編寫一個void sort(int *x,int n)實現將x數組中的n個數據從大到小  排序。n及數組元素在主函數中輸入。將結果顯示在屏幕上並輸出到文件f1.txt中*/ #include <iostream> #includ

原创 GCC的用法

1 gcc 文件名字 -o 自己起名字   再運行 ./自己起的名字 2 直接運行gcc 文件名字  自動就生成了一個a.out的文件 然後運行命令 ./a.out 更多詳細內容見一下csdn下載地址  一個gcc的pdf文檔 http:

原创 C++版基本算法3--分塊查找

//分塊查找算法 #include <iostream> using namespace std; struct index  //定義一個結構體用來分塊 {int key;int start;int end; }index[4]; i

原创 C++版基本算法2--折半查找

//折半查找算法 #include <iostream> using namespace std; int search(int a[],int n,int x);  //函數聲明 int main() {int i,x,z;int a[

原创 ns2 Tcl腳本程序解析

set ns [new Simulator]  ;#建立一個simulator對象 set tracefd [open no1.tr w]  ;#注

原创 ns-2中Tcl語言中類的使用

Class mom mom instproc greet {} {  ;#注意greet後面的空格然後纔是{} ,一定注意要有空格 $self instvar age_ puts "$age_ year old mom say: How

原创 六級Translation

① 中國新年 (2010.12)   Chinese New Year is the most important traditional Chinese holiday. In China, it  is also known as t

原创 sizeof 的用法

一、sizeof的概念     sizeof是C語言的一種單目操作符,如C語言的其他操作符++、--等。     它並不是函數。     sizeof操作符以字節形式給出了其操作數的存儲大小。     操作數可以是一個表達式或括在

原创 C++中有關內存的思考

1 #include <iostream> using namespace std; void GetMemory(char *p) {p=(char *)malloc(100); } void Test(void) {char *str

原创 C++版排序算法1--選擇排序

每一趟從待排序的數據元素中選出最小(或最大)的一個元素,順序放在已排好序的數列的最後,直到全部待排序的數據元素排完。 選擇排序是不穩定的排序方法。 #include <iostream> using namespace std; int

原创 the+比較級,the+比較級

“the+比較級,the+比較級”意爲“越……越……”,表示一方的程度隨着另一方的變化而變化,其中的兩個the都是副詞,而不是冠詞。本文擬從以下幾個方面對此句式作一淺析,希望能幫助同學們加深理解。      一、對主、從句的理解