poo1_u4_a3.docx

4
HTTP://WWW.UNADMEXICO.MX Actividad 3. Inversión de arreglos Unidad 4. Arreglos

Upload: ivanalexander123

Post on 31-Dec-2015

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: POO1_U4_A3.docx

Actividad 3. Inversión de arreglos

Unidad 4. Arreglos

Page 2: POO1_U4_A3.docx

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();

Page 3: POO1_U4_A3.docx

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

}

}

}