Advertisement
SrJefers_Loading

Untitled

Sep 4th, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <conio.h>
  3. #include <math.h>
  4. #include <Windows.h>
  5.  
  6. int main()
  7. {
  8. int m[100][100],ope, x1, y1, x2, y2, f1, c1, f2, c2, v, a, b, n1, n2;
  9. ope=0;
  10. while (ope!=5)
  11. {
  12. clrscr();
  13. cout <<" Menu Principal" <<endl;
  14. cout <<"1.Suma de matrices" <<endl;
  15. cout <<"2.Resta de Matrices" <<endl;
  16. cout <<"3.Multiplicacion de Matrices" <<endl;
  17. cout <<"5.Salir" <<endl;
  18. cin >>ope;
  19. switch (ope) //aca estaba el error aaa solo era de subir el switch o eso digo yo va vos aaa
  20. {
  21. case 1:
  22. clrscr();
  23. cout <<"Ingrese numero de filas de la matriz 1: ";
  24. cin>>f1;
  25. cout<<"Ingrese el numero de columnas de la matriz 1: ";
  26. cin>>c1;
  27. cout <<"Ingrese numero de filas de la matriz 2: ";
  28. cin>>f2;
  29. cout<<"Ingrese el numero de columnas de la matriz 2: ";
  30. cin >>c2;
  31. clrscr();
  32. if(f1==f2 && c1==c2)
  33. {
  34. for(x1=0;x1<f1;x1++)
  35. {
  36. for(y1=0;y1<c1;y1++)
  37. {
  38. cout<<"Matriz 1 (" <<x1 <<"," <<y1 <<"): ";
  39. cin>>n1;
  40. m[x1][y1] = n1;
  41. }
  42. }
  43. cout<<"\n";
  44. cout<<"Matriz A= \n";
  45. for(x1=0;x1<f1;x1++)
  46. {
  47. for(y1=0;y1<c1;y1++)
  48. {
  49. cout<<m[x1][y1] <<" ";
  50. }
  51. cout<<"\n";
  52. }
  53. cout<<"\n";
  54. for(x2=0;x2<f2;x2++)
  55. {
  56. for(y2=0;y2<c2;y2++)
  57. {
  58. cout<<"Matriz 2 (" <<x2 <<"," <<y2 <<"): ";
  59. cin>>n2;
  60. m[x2][y2] = n2;
  61. }
  62. }
  63. cout<<"\n";
  64. cout<<"Matriz B= " <<endl;
  65. for(x2=0;x2<f2;x2++)
  66. {
  67. for(y2=0;y2<c2;y2++)
  68. {
  69. cout<<m[x2][y2] <<" ";
  70. }
  71. cout<<"\n";
  72. }
  73. cout<<"\n";
  74. getch();
  75. break;
  76. }
  77. }
  78. }
  79. getch ();
  80. return 0;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement