online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ // Matrices /* Un programa pida datos al usuario los datos de una matriz de 2×2 y muestra su traspuesta (el resultado de intercambiar filas por columnas). */ #include<iostream> #include<locale.h> #include<conio.h> int main(){ setlocale(LC_CTYPE, "Spanish"); int n = 0, m = 0, opt = 0; system("cls"); std::cout<<"MATRICES"<<std::endl; std::cout<<std::endl; std::cout<<"Ingrese las medida de su matriz"<<std::endl<<"Filas = "; std::cin>>n; std::cout<<"Columnas = "; std::cin>>m; std::cout<<std::endl; double mz[n][m] = {}; std::cout<<"Ingreso de datos de matriz "<<n<<" x "<<m<<std::endl; for(int i = 0; i<=n-1; i++){ for(int j = 0; j<=m-1; j++){ std::cout<<"["<<i+1<<"] ["<<j+1<<"] = "; std::cin>>mz[i][j]; } std::cout<<std::endl; } std::cout<<"Matriz "<<n<<" x "<<m<<std::endl; for(int i = 0; i<=n-1; i++){ std::cout<<"| "; for(int j = 0; j<=m-1; j++){ std::cout<<mz[i][j]<<" | "; } std::cout<<std::endl; } std::cout<<std::endl; if(n<m){ std::cout<<"Matriz tranpuesta "<<m<<" x "<<n<<std::endl; for(int i = 0; i<=m-1; i++){ std::cout<<"| "; for(int j = 0; j<=n-1; j++){ std::cout<<mz[j][i]<<" | "; } std::cout<<std::endl; } } else if(n>m){ std::cout<<"Matriz tranpuesta "<<m<<" x "<<n<<std::endl; for(int i = 0; i<m; i++){ std::cout<<"| "; for(int j = 0; j<n; j++){ std::cout<<mz[j][i]<<" | "; } std::cout<<std::endl; } } else{ std::cout<<"Matriz tranpuesta "<<n<<" x "<<m<<std::endl; for(int i = 0; i<=n-1; i++){ std::cout<<"| "; for(int j = 0; j<=m-1; j++){ std::cout<<mz[j][i]<<" | "; } std::cout<<std::endl; } } do{ std::cout<<std::endl<<"Volver a ingresar matriz[1] // Salir del programa[2]"<<std::endl<<"Opción = "; std::cin>>opt; if(opt == 1){ std::cout<<std::endl; return main(); } else if(opt > 2 || opt <= 0){ std::cout<<"-----ERROR: Solo puede elegir el 1 o el 2-----"<<std::endl; } else{ std::cout<<std::endl<<"Gracias por usar este programa :D"; getch(); return 0; } }while(opt >= 3 || opt<=0); 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