poo1_u4_a3.docx

Post on 31-Dec-2015

230 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Actividad 3. Inversión de arreglos

Unidad 4. Arreglos

Programación Orientada a Objetos IUnidad 4. ArreglosActividad 3. Inversión de arreglos

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package prueba;

import java.util.Scanner;

/**

*

* @author Iván A. Maldonado Ibarra

*/

public class Prueba {

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

int x;

int y;

System.out.println("* Actividad 3 *");

System.out.println("* Ingrese X *");

Scanner reader = new Scanner(System.in);

x = reader.nextInt();

System.out.println("* Ingrese Y *");

y = reader.nextInt();

int [][] caso = new int [x][y];

for(int i=0;i<x;i++){

for(int j=0;j<y;j++){

System.out.println("->Ingrese("+(i+1)+",… : ");

caso[i][j]=reader.nextInt();

}

}

System.out.println("Valores en orden inverso");

for(int i=x-1;i>=0;i--){

for(int j=y-1;j>=0;j--){

System.out.println(caso[i][j]+" ");

}

System.out.println();

Programación Orientada a Objetos IUnidad 4. ArreglosActividad 3. Inversión de arreglos

}

}

}

top related