-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLab1_updated.java
More file actions
50 lines (46 loc) · 1.1 KB
/
Lab1_updated.java
File metadata and controls
50 lines (46 loc) · 1.1 KB
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
44
45
46
47
48
49
50
import java.io.*;
import java.lang.Integer;
import java.lang.String;
import java.util.Vector;
public class Lab1 {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(isr);
System.out.print(">");
String s;
Chuli a = new Chuli();
while( (s = reader.readLine()) != null ) {
if (!a.judge(s)) {
System.out.println("Input Error!");
}
else {
if (s.charAt(0)!='!') {
a = new Chuli();
s = s.replaceAll(" ","");
s = s.replaceAll(" ","");
}
a.expression(s);
a.simplify(s);
}
System.out.print("\n>");
}
}
}
class Xiang{
public int xishu=1;
public Vector<String> var;
public Vector<Integer> mi;
public Xiang(){
xishu=1;
var=new Vector<String>();
mi=new Vector<Integer>();
}
}
class Fuzhi{
public Vector<String> var;
public Vector<Integer> zhi;
public Fuzhi(){
var=new Vector<String>();
zhi=new Vector<Integer>();
}
}