Powered By Blogger

lunes, 10 de octubre de 2011

Programa de Pila (Incertando datos)

import java.util.*;
public class PilaEstatica {
    public static void main(String[] args) {
      Scanner teclado = new Scanner (System.in);
   System.out.println("Ingrese numero \n");
        int opcion ;
       int  tope, dato = 0;
       int op2= teclado.nextInt();
       int op=teclado.nextInt();
       int pila [] = new int [10];
       int nextInt = teclado.nextInt();
       for (tope=0; tope<9 ; tope++) {
       pila [tope]=teclado.nextInt();
        System.out.println("imprimir pila ...........1");
        System.out.println("");
        op=teclado.nextInt();
        switch (op){
            case 1:
                if (op ==1)
                System.out.println("Vaciar Pila  ");
                 for (tope=9; tope>=0; tope --){
                 System.out.println(""+pila[tope]);
                }
        }
   }
 }    
}      
 

No hay comentarios:

Publicar un comentario