12345678910111213141516171819202122
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <iomanip> #include <iostream> using namespace std; int main () { int matrix[3][3] = {{1,2,3,}, {4,5,6}, {7,8,9}}; for (int i = 0; i < 3; i++) { for (int j = 0; j <3; j++) cout<<" "<<matrix[j][i]; cout<<endl; } return 0; }