package ejercicios;
import java.util.Scanner;
public class ejercicio6 {
public static void main(String[] args) {
int i,j,n;
Scanner let= new Scanner (System.in);
int[] []matriz=new int[10][10];
cargarmatriz(matriz,10);
mostrarmatriz(matriz);
}
static void cargarmatriz (int[][] matriz, int n) {
int num,k=0,j=0,i=0;
int prod=1,cont=0;
int[ ] nume = {1, 2,3,4,5,6,7,8,9,10 };
//int[ ] nume = {1, 2};
Scanner let= new Scanner (System.in);
do { // matriz[i][j]=num;
for(i=0;i<n;++i){
for(j=0;j<n;++j){
do {
System.out.println("ingrece elementos de la matriz entre 1 y 10");
num=let.nextInt();
} while (num>10 || num<0) ;
for(k=0;k<10;++k) {
prod=num*nume[k];
matriz[i][j]=prod;
++j;
}
}}
// for(int t=0;t<1;++t) {
// prod=num*nume[t];
// matriz[i][j]=num;
// ++k;
// ++i;
// }
++cont;
}while(cont==10);
}
static void mostrarmatriz (int[][] matriz) {
for(int i = 0; i < matriz.length; i++){
for(int j = 0; j < matriz[i].length; j++){
System.out.print(matriz[i][j] + " ");
}
System.out.println();
}
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}