20 by clamitze

VIEWS: 15 PAGES: 1

									#include<iostream.h> #include<conio.h> #include<fstream.h> fstream f("mat.in",ios::in); fstream g("transp.out",ios::out); void main() { clrscr(); int a[10][10],n,i,j,c[10][10],s; f>>n; for(i=1;i<=n;i++) for(j=1;j<=n;j++) f>>a[i][j]; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) cout<<a[i][j]; cout<<endl; } cout<<endl; for(i=1;i<=n;i++) {for(j=1;j<=n;j++) c[i][j]=a[j][i]; } for(i=1;i<=n;i++) for(j=1;j<=n;j++) g<<c[i][j]; getch(); }


								
To top