?? ex15(2).java
字號(hào):
// holding/Ex15.java
// TIJ4 Chapter Holding, Exercise 15, page 415
/* Stacks are often used to evaluate expressions in programming
* languages. Using net.mindview.util.Stack, evaluate the following
* expression, where '+' means "push the following letter onto the
* stack," and '-' means "pop the top of the stack and print it":
* "+U+n+c---+e+r+t---+a+i+n+t+y---+ -+r+u--+l+e+s---"
*/
import net.mindview.util.*;
public class Ex15 {
public static void main(String[] args) {
Stack<Character> sc = new Stack<Character>();
sc.push('U');
sc.push('n');
sc.push('c');
System.out.print(sc.pop());
System.out.print(sc.pop());
System.out.print(sc.pop());
sc.push('e');
sc.push('r');
sc.push('t');
System.out.print(sc.pop());
System.out.print(sc.pop());
System.out.print(sc.pop());
sc.push('a');
sc.push('i');
sc.push('n');
sc.push('t');
System.out.print(sc.pop());
System.out.print(sc.pop());
System.out.print(sc.pop());
sc.push(' ');
System.out.print(sc.pop());
sc.push('r');
sc.push('u');
System.out.print(sc.pop());
System.out.print(sc.pop());
sc.push('l');
sc.push('e');
sc.push('s');
System.out.print(sc.pop());
System.out.print(sc.pop());
System.out.print(sc.pop());
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -