fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <bits/stdc++.h>
  4. #include <climits>
  5. #include <deque>
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11. int m = 3, n = 2;
  12.  
  13. int *arr[m];
  14.  
  15. for(int i = 0; i < m; i++)
  16. arr[i] = new int[i];
  17.  
  18. for(int i = 0; i < 3; i++)
  19. {
  20. for(int j = 0; j < i; j++)
  21. {
  22. arr[i][j] = 10;
  23.  
  24. cout << arr[i][j] << " ";
  25. }
  26. }
  27. arr[3][2]=10;
  28. cout<<arr[3][2];
  29.  
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5372KB
stdin
Standard input is empty
stdout
10 10 10 10