fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std ;
  4.  
  5. int main()
  6. {
  7. int tab[4][3] = {1, 2, 3,
  8. 4, 5, 6,
  9. 7, 8, 9,
  10. 0, 1, 2} ;
  11.  
  12. for (int i = 0 ; i < 4 ; i++)
  13. {
  14. for (int j = 0 ; j < 3 ; j++)
  15. {
  16. cout << tab[i][j] << ' ' ;
  17. }
  18.  
  19. cout << endl ;
  20. }
  21.  
  22. cout << endl ;
  23.  
  24. for (int i = 0 ; i < 3 ; i++)
  25. {
  26. for (int j = 0 ; j < 4 ; j++)
  27. {
  28. cout << tab[j][i] << ' ' ;
  29. }
  30.  
  31. cout << endl ;
  32. }
  33. }
  34.  
Success #stdin #stdout 0s 3344KB
stdin
Standard input is empty
stdout
1 2 3 
4 5 6 
7 8 9 
0 1 2 

1 4 7 0 
2 5 8 1 
3 6 9 2