fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int N = 5;
  5.  
  6. int arr1[N] = { 1 };
  7. int arr2[N] = { 2, 3 };
  8. int arr3[N][N] = { 4, 5 };
  9.  
  10. int main() {
  11. for (int i = 0; i < N; i++) {
  12. printf(" %d", arr1[i]);
  13. }
  14. printf("\n");
  15. for (int i = 0; i < N; i++) {
  16. printf(" %d", arr2[i]);
  17. }
  18. printf("\n\n");
  19. for (int i = 0; i < N; i++) {
  20. for (int j = 0; j < N; j++) {
  21. printf(" %d", arr3[i][j]);
  22. }
  23. printf("\n");
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
 1 0 0 0 0
 2 3 0 0 0

 4 5 0 0 0
 0 0 0 0 0
 0 0 0 0 0
 0 0 0 0 0
 0 0 0 0 0