Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- using namespace std;
- using namespace System;
- int main (){
- int n,m;
- cout<<"Numero de filas = ";cin>>n;
- cout<<"Numero de columnas = ";cin>>m;
- if(n!=m) return 0;
- int **M;
- M=new int*[n];
- for (int i= 0;i < n; i++)
- M[i] = new int[m];
- for(int i=0;i<n;i++){
- for(int j=0;j<m;j++){
- cout<<"Ingrese el valor para la posicion ("<<i<<","<<j<<")"<<endl;
- cin>>M[i][j];
- }
- }
- cout<<"La matriz es "<<endl;
- for(int i=0;i<n;i++){
- for (int j=0;j<m;j++){
- cout<<M[i][j]<<" ";
- }
- cout<<endl;
- }
- bool essim=true;
- for (int i=0;i<n;i++){
- for (int j=0;j<m;j++){
- if(M[i][j]!=M[j][i]){essim=false;}
- }
- }
- if (essim) cout<<"Es simetrica."<<endl; else cout<<"No es simetrica."<<endl;
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement