Advertisement
rotti321

MatSim

Apr 12th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #define nmax 100
  3.  
  4. using namespace std;
  5.  
  6. int v[1000001]={};
  7.  
  8. int main ()
  9. {
  10.     int n,m,a[nmax+2][nmax+2]={},k=0,b[nmax+2][nmax+2]={};
  11.     cin>>n;
  12.  
  13.     for(int i=1;i<=n;i++)
  14.     {
  15.         for(int j=1;j<=n;j++)
  16.         {
  17.             cin>>a[i][j];
  18.         }
  19.     }
  20.  
  21.  for(int i=1;i<=n;i++)
  22.     {
  23.         for(int j=1;j<=n;j++)
  24.         {
  25.             b[i][j]=a[j][i];
  26.         }
  27.     }
  28.      for(int i=1;i<=n;i++)
  29.     {
  30.         for(int j=1;j<=n;j++)
  31.         {
  32.             cout<<b[i][j]<<" ";
  33.  
  34.  
  35.         }
  36.         cout<<endl;
  37.     }
  38.  
  39.  
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement