View Code of Problem 45

#include <iostream>

using namespace std;

int main()
{
   int n,arr[100][100],res[100][100];
   cin>>n;
   for(int i=0;i<n;i++){
       for(int j=0;j<n;j++){
           cin>>arr[i][j];
           res[j][i]=arr[i][j];
       }
   }

   for(int i=0;i<n;i++){
       for(int j=0;j<n-1;j++){
            cout<<res[i][j]<<" ";
       }
       cout<<res[i][n-1]<<endl;
   }





   return 0;
}

Double click to view unformatted code.


Back to problem 45