matriz con método

14
Matriz con método 1 Dadas dos matrices A y B intercambiar los minimos de A con los maximos de B package matrizconmetod; import java.util.Scanner; public class matrizconmetod { Scanner Leer = new Scanner(System.in); public static void llenar (int M [] [], int f, int c) { Scanner Leer = new Scanner(System.in); for (int i = 1 ; i <= f ; i++) { for (int j = 1 ; j <= c ; j++) { System.out.print ("Inserte pos[" + i + "][" + j + "]: "); M [i] [j] = Leer.nextInt(); } } } public static void mostrar (int M [] [], int f, int c) { for (int i = 1 ; i <= f ; i++) { System.out.println (); for (int j = 1 ; j <= c ; j++) { System.out.print ("[" + M [i] [j] + "]"); } } } public static int menor (int M [] [], int f, int c) { int men = M [1] [1]; for (int i = 1 ; i <= f ; i++) { for (int j = 1 ; j <= c ; j++) { if (M [i] [j] < men) { men = M [i] [j]; } } } return (men); } public static int maximo (int M [] [], int f, int c)

Upload: javier-tapia

Post on 30-Sep-2015

11 views

Category:

Documents


3 download

DESCRIPTION

progrmacion java

TRANSCRIPT

Matriz con mtodo1 Dadas dos matrices A y B intercambiar los minimos de A con los maximos de Bpackage matrizconmetod;import java.util.Scanner; public class matrizconmetod { Scanner Leer = new Scanner(System.in); public static void llenar (int M [] [], int f, int c) { Scanner Leer = new Scanner(System.in); for (int i = 1 ; i