int **p; int m;//你要开辟空间的大小; cin>>m;//要用时输入大小 p=new int *[m]; for(int i = 0; i m; i++) *p[i] = new int[m]; 然后用对P[m][m] 赋值;