Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <conio.h>
- #include <math.h>
- #include <Windows.h>
- int main()
- {
- int m[100][100],ope, x1, y1, x2, y2, f1, c1, f2, c2, v, a, b, n1, n2;
- ope=0;
- while (ope!=5)
- {
- clrscr();
- cout <<" Menu Principal" <<endl;
- cout <<"1.Suma de matrices" <<endl;
- cout <<"2.Resta de Matrices" <<endl;
- cout <<"3.Multiplicacion de Matrices" <<endl;
- cout <<"5.Salir" <<endl;
- cin >>ope;
- switch (ope) //aca estaba el error aaa solo era de subir el switch o eso digo yo va vos aaa
- {
- case 1:
- clrscr();
- cout <<"Ingrese numero de filas de la matriz 1: ";
- cin>>f1;
- cout<<"Ingrese el numero de columnas de la matriz 1: ";
- cin>>c1;
- cout <<"Ingrese numero de filas de la matriz 2: ";
- cin>>f2;
- cout<<"Ingrese el numero de columnas de la matriz 2: ";
- cin >>c2;
- clrscr();
- if(f1==f2 && c1==c2)
- {
- for(x1=0;x1<f1;x1++)
- {
- for(y1=0;y1<c1;y1++)
- {
- cout<<"Matriz 1 (" <<x1 <<"," <<y1 <<"): ";
- cin>>n1;
- m[x1][y1] = n1;
- }
- }
- cout<<"\n";
- cout<<"Matriz A= \n";
- for(x1=0;x1<f1;x1++)
- {
- for(y1=0;y1<c1;y1++)
- {
- cout<<m[x1][y1] <<" ";
- }
- cout<<"\n";
- }
- cout<<"\n";
- for(x2=0;x2<f2;x2++)
- {
- for(y2=0;y2<c2;y2++)
- {
- cout<<"Matriz 2 (" <<x2 <<"," <<y2 <<"): ";
- cin>>n2;
- m[x2][y2] = n2;
- }
- }
- cout<<"\n";
- cout<<"Matriz B= " <<endl;
- for(x2=0;x2<f2;x2++)
- {
- for(y2=0;y2<c2;y2++)
- {
- cout<<m[x2][y2] <<" ";
- }
- cout<<"\n";
- }
- cout<<"\n";
- getch();
- break;
- }
- }
- }
- getch ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement