-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFooRPL.java
More file actions
43 lines (41 loc) · 889 Bytes
/
FooRPL.java
File metadata and controls
43 lines (41 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
public class FooRPL{
public static void main(String[] args){
PileRPL pile = new PileRPL();
ObjEmpilable oe1 = new ObjEmpilable(21);
ObjEmpilable oe2 = new ObjEmpilable(42);
pile.push(oe1);
System.out.println(pile);
pile.push(oe2);
System.out.println(pile);
pile.add();
System.out.println(pile);
//SOU
pile.push(oe2);
System.out.println(pile);
pile.sou();
System.out.println(pile);
//MUL
ObjEmpilable oe3 = new ObjEmpilable(2);
pile.push(oe3);
System.out.println(pile);
pile.mul();
System.out.println(pile);
//DIV
pile.push(oe3);
System.out.println(pile);
pile.div();
System.out.println(pile);
pile.push(oe3);
pile.push(oe3);
pile.push(oe3);
//test max
pile.push(oe3);
pile.push(oe3);
pile.push(oe3);
pile.push(oe3);
pile.push(oe3);
int i = pile.push(oe3);
System.out.println(pile);
System.out.println(i);
}
}