03 2015 档案
摘要:1 /***顺序表上的基本操作实现***/ 2 3 #include 4 5 #define SIZE 1008 6 7 #define LIST_INIT_SIZE 100 8 #define LISTINCREMENT 10 9 #define OVERFLOW 0...
阅读全文
摘要:1 #include 2 3 void Qsort(int a[],int low,int high) 4 { 5 if(low>=high) 6 return; 7 int first=low; 8 int last=high; 9 in...
阅读全文
摘要:1 #include 2 3 int* selectionSort(int datas[], int size) 4 { 5 int* temp = new int[size]; 6 int f,k; 7 for(int i=0;i<size;i++) 8 { ...
阅读全文
摘要:1 #include 2 3 int* mergeSort(int data1[], int data2[], int size1, int size2) 4 { 5 int* temp = new int[size1+size2]; 6 int i = 0,j = 0, t=...
阅读全文
摘要:1 /* 2 二分法查找 3 查找有序数组datas中数字number在第几位 4 若datas[j]=number,则返回j;如果不存在j使datas[j]=number,则返回-1; 5 */ 6 int binarySearch(int datas[],int size,int ...
阅读全文
摘要:1 int* insertionSort(int datas[],int len) 2 { 3 int* temp = new int[len];// 定义一个指向数组的指针 4 int i,x; 5 6 for(int j=1;j=0)11 {12 ...
阅读全文
摘要:1 int* insertionSort(int datas[],int len) 2 { 3 int* temp = new int[len];// 定义一个指向数组的指针 4 int i,x; 5 6 for(int j=1;j=0)11 {12 ...
阅读全文
摘要:1 #include 2 3 void function(int datas[],int len) 4 { 5 for(int j=0;j<len;j++) 6 { 7 cout << datas[j] << endl; 8 } 9 }10 11 int...
阅读全文
摘要:1 #include 2 #include 3 4 int main(int argc, char* argv[]) 5 { 6 cout usingnamespacestd;floatFuncP(inta,floatb){returna+b;}intFuncNP(){return3...
阅读全文
摘要:There are five data types for C: void, integer, float, double, and char.TypeDescriptionvoidassociated with no data typeintintegerfloatfloating-point n...
阅读全文
摘要:整型 1,在java中,整型的范围与运行java代码的机器无关,从而解决在不同平台之间移植的问题。例如:byte型占1个字节,short型占2个字节,int型占4个字节,long型占8个字节。相反,在C或者C++中,程序会根据不同的处理器现则最为有效的整型。这也是C++效率较高的一个原因。 2,在j...
阅读全文
摘要:1 #include 2 #include 3 #include 4 5 void main() 6 { 7 ifstream inFile; 8 ofstream outFile; 9 outFile.open("my.txt", ios::out);10 ...
阅读全文
摘要:#include void main(){ int a,b; cin >> a >> b; cout Settings->C/C++->Precompile Header,设置为第一项:Not using precompile headers。 解决方案2:在.cpp文件开头添加包含文件s...
阅读全文