1 #include <iostream>
 2 using namespace std;
 3 
 4 int main(){
 5     int row,column,k=0;
 6     cin >> row >> column;
 7 
 8     int **p =  new int* [row];
 9     for(int i = 0; i < row; i++)
10         p[i] = new int[column];
11 
12     for(int i = 0; i < row; i++)
13         for(int j = 0; j < column; j++)
14             p[i][j] = ++k;
15 
16     for(int i = 0; i < row; i++){
17         for(int j = 0; j < column; j++)
18             cout << p[i][j] << " ";
19         cout << endl;
20     }
21 
22     for(int i = 0; i < row; i++)
23         delete []p[i];
24     p = NULL;
25     return 0;
26 }

 

相关文章:

  • 2021-09-28
  • 2023-01-11
  • 2022-12-23
  • 2021-08-13
  • 2021-11-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案