31 by clamitze

VIEWS: 8 PAGES: 1

									#include<iostream.h> #include<conio.h> #include<fstream.h> fstream f("mat.in",ios::in); void main() { clrscr(); int a[10][10],n,i,j,s=0,c[10][10]; 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++) if(a[i][j]==c[i][j]) s++;} if(s==n*n) cout<<"matricea este simetrica"; else cout<<"matricea nu este simetrica"; getch(); }


								
To top