Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class EjemploJava15{
- public static void llenar(int m[][],int f, int c){
- Scanner input=new Scanner(System.in);
- int i,j;
- for(i=0;i<f;i++){
- for(j=0;j<c;j++){
- m[i][j]=input.nextInt();
- }
- }
- }
- public static void mostrar(int m[][],int f,int c){
- int i,j;
- for(i=0;i<f;i++){
- for(j=0;j<c;j++){
- System.out.print("["+m[i][j]+"]");
- }
- System.out.println("");
- }
- }
- public static void main(String args[]){
- Scanner input=new Scanner(System.in);
- int m[][],f,c;
- f=input.nextInt();
- c=input.nextInt();
- m=new int[f][c];
- llenar(m,f,c);
- mostrar(m,f,c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement