高手们,能不能帮我看看我的code问题在哪里呢,谢谢
#include <iostream>using std::cout;
using std::cin;
using std::endl;
// contains function prototypes for functions srand and rand
#include <cstdlib>
#include <ctime> // contains prototype for function time
// function prototype
int main()
{
int m;
int n;
cout<<"please input the number of row"<<endl;
cin>> m ;
cout<<"please input the number of column"<<endl;
cin>> n ;
int* A=new int [m+n][m*n];
//generate the A matrix//
for (int i=0;i<m;i++) for (int j=0;j<n;j++) A[i][n*i+j]=1;
for (int i=0;i<n;i++) for (int j=0;j<m;j++) A[m+i][n*j+i]=1;
//Print A matrix for test//
for (int i=0;i<(m+n);i++)
{
for (int j=0;j<m*n;j++) cout<<A[i][j]<<" ";
cout<<endl;
}
delete [] rowsum;
delete [] colsum;
return 0; // indicates successful termination
} // end main
[ 本帖最后由 weiwei859 于 2011-5-12 11:21 编辑 ]