Skip to content

Instantly share code, notes, and snippets.

@leopic
Created June 22, 2013 17:17
Show Gist options
  • Select an option

  • Save leopic/5841648 to your computer and use it in GitHub Desktop.

Select an option

Save leopic/5841648 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
int dimensiones,
entrada,
i,
j;
/*cout << "Dimensiones del vector: " << endl;
cin >> dimensiones;
int matriz[dimensiones][dimensiones];
// recorriendo las filas
for (i = 0; i < dimensiones; i++) {
// recorriendo las columnas
for(j = 0; j < dimensiones; j++) {
cout << "viene la bolita: " << i << j << endl;
cin >> entrada;
matriz[i][j] = entrada;
}
}
cout << "-- ~~ -- ~~ -- ~~ --" << endl;
// recorriendo las filas
for (i = 0; i < dimensiones; i++) {
// recorriendo las columnas
for(j = 0; j < dimensiones; j++) {
// barra al inicio de las filas
if (j == 0) {
cout << "| ";
}
cout << matriz[i][j] << " | ";
// final de la linea
if (j == dimensiones-1) {
cout << endl;
}
}
}
cout << "-- ~~ -- ~~ -- ~~ --" << endl;*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment