Facebook
From Mustard Wolf, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 216
  1. void zamien() throws EmptyStackException{
  2.     Scanner sc = new Scanner(System.in);
  3.     while(sc.hasNext()){
  4.         String[] lol = sc.nextLine().split(" ");
  5.             if(lol[0].equals("end")) break;
  6.         for(int i= 0; i<lol.length; i++)
  7.         push(lol[i]);
  8.    
  9.        while(!isEmpty()){
  10.             System.out.print(pop().toString() + " ");
  11.        }  
  12.        System.out.println();
  13.     }