online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
//PROYECTO 4: Elabora una calculadora de matrices. Sumas y Restas. #include <iostream> #include<clocale> using namespace std; int main() { int medida=0; char opcion='R'; setlocale(LC_CTYPE, "Spanish"); cout<<"SUMA DE MATRICES: Para sumar y/o restar dos matrices, el tamaño de las dos debe ser el mismo"<<endl; cout<<"Ingresa el tamaño de las matrices, si es 3x3 ingresar sólo 3,"<<endl<<" si es 4x4 ingresar sólo 4, y así sucesivamente"<<endl; cin>>medida; int m1[medida][medida]={}; int m2[medida][medida]={}; int m3[medida][medida]={}; for (int i=0; i<=medida-1; i++ ){ for(int j=0; j<=medida-1; j++){ cout<<" Ingresa los elementos de la matriz1 ["<<i<<"]"<<"["<<j<<"]: "; cin>>m1[i][j]; } } cout<<endl; for (int i=0; i<=medida-1; i++ ){ for(int j=0; j<=medida-1; j++){ cout<<" Ingresa los elementos de la matriz 2 ["<<i<<"]"<<"["<<j<<"]: "; cin>>m2[i][j]; } } cout<<" MATRIZ 1"<<endl; for (int i=0; i<=medida-1; i++ ){ for(int j=0; j<=medida-1; j++){ cout<<" "<<m1[i][j]<<" "; }cout<<endl; } cout<<" MATRIZ 2"<<endl; for (int i=0; i<=medida-1; i++ ){ for(int j=0; j<=medida-1; j++){ cout<<" "<<m2[i][j]<<" "; }cout<<endl; } cout<<"Si desea sumar escribe la letra S, si desea restar las matrices escribe la letra R."<<endl; cout<<"¿Qué operación desea hacer?: "; cin>>opcion; if (opcion=='S'|| opcion=='s'){ for (int i=0; i<=medida-1; i++ ){ for(int j=0; j<=medida-1; j++){ m3[i][j]=m1[i][j]+m2[i][j]; cout<<m3[i][j]<<" "; }cout<<endl; } } if (opcion=='R'|| opcion=='r'){ for (int i=0; i<=medida-1; i++ ){ for(int j=0; j<=medida-1; j++){ m3[i][j]=m1[i][j]-m2[i][j]; cout<<m3[i][j]<<" "; }cout<<endl; } } if(opcion=='s'||opcion=='S'||opcion=='R'||opcion=='r'){ return 0; }else{return main(); } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue