摘要: #include <iostream>#include <iomanip>using namespace std;int main(){ int M=0; int a; int i,j,k; cout<<"请输入矩阵维数"<<endl; cin>>a; int **A; A=new int*[a]; //指针数组 for (i=0;i<a;i++) { A[i]=new int[a]; } int **B; B=new int*[a]; for (i=0;i<a;i++) { B[... 阅读全文
posted @ 2012-03-15 20:37 碧海一波 阅读(1416) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;void MERGES(int *A,int p,int q,int r) //下标 P<=q<r{ int n1=q-p+1; //n1:p,q之间的数的个数 int n2=r-q; //n2:q以后到r的数的个数 int *L=new int [n1+1], //动态申请两个子数组 *R=new int [n2+1]; int i,j,k; for (i=0;i<n1;i++) { L[i]=A[p+i-1]; } for (j=... 阅读全文
posted @ 2012-03-15 15:19 碧海一波 阅读(426) 评论(0) 推荐(0) 编辑