Advertisement
Guest User

Untitled

a guest
Jul 6th, 2019
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. import java.util.*;
  2. public class EjemploJava15{
  3. public static void llenar(int m[][],int f, int c){
  4. Scanner input=new Scanner(System.in);
  5. int i,j;
  6. for(i=0;i<f;i++){
  7. for(j=0;j<c;j++){
  8. m[i][j]=input.nextInt();
  9. }
  10. }
  11. }
  12. public static void mostrar(int m[][],int f,int c){
  13. int i,j;
  14. for(i=0;i<f;i++){
  15. for(j=0;j<c;j++){
  16. System.out.print("["+m[i][j]+"]");
  17. }
  18. System.out.println("");
  19. }
  20. }
  21. public static void main(String args[]){
  22. Scanner input=new Scanner(System.in);
  23. int m[][],f,c;
  24. f=input.nextInt();
  25. c=input.nextInt();
  26. m=new int[f][c];
  27. llenar(m,f,c);
  28. mostrar(m,f,c);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement