Advertisement
NoExisteLink

Untitled

Jun 27th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <conio.h>
  4. using namespace std;
  5. using namespace System;
  6.  
  7. int main (){
  8. int n,m;
  9. cout<<"Numero de filas = ";cin>>n;
  10. cout<<"Numero de columnas = ";cin>>m;
  11. if(n!=m) return 0;
  12. int **M;
  13. M=new int*[n];
  14. for (int i= 0;i < n; i++)
  15. M[i] = new int[m];
  16.  
  17. for(int i=0;i<n;i++){
  18. for(int j=0;j<m;j++){
  19. cout<<"Ingrese el valor para la posicion ("<<i<<","<<j<<")"<<endl;
  20. cin>>M[i][j];
  21. }
  22. }
  23. cout<<"La matriz es "<<endl;
  24. for(int i=0;i<n;i++){
  25. for (int j=0;j<m;j++){
  26. cout<<M[i][j]<<" ";
  27. }
  28. cout<<endl;
  29. }
  30. bool essim=true;
  31. for (int i=0;i<n;i++){
  32. for (int j=0;j<m;j++){
  33. if(M[i][j]!=M[j][i]){essim=false;}
  34. }
  35. }
  36. if (essim) cout<<"Es simetrica."<<endl; else cout<<"No es simetrica."<<endl;
  37. _getch();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement