Ai
1 Star 0 Fork 0

CS-IMIS-23/20172305TX

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fourTest.java 968 Bytes
一键复制 编辑 原始数据 按行查看 历史
package ShiYan2;
import seventhweek.LinkedBinaryTree;
import seventhweek.PostfixEvaluator;
import java.util.Scanner;
public class fourTest {
public static void main(String[] args) {
InfixSuffixTree tree = new InfixSuffixTree();
LinkedBinaryTree<String> linkedBinaryTree = new LinkedBinaryTree<String>();
PostfixEvaluator evaluator = new PostfixEvaluator();
String temp1, temp2, another = "y";
Scanner scan = new Scanner(System.in);
while(another.equalsIgnoreCase("y")){
System.out.print("Please enter what you want to calculate::");
temp1 = scan.nextLine();
linkedBinaryTree.root = (tree.change(temp1));
temp2 = tree.toString();
System.out.println("Answer:" + evaluator.evaluate(temp2));
System.out.println("Do you want to try again?(yes/no):");
another = scan.nextLine();
System.out.println();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/CS-IMIS-23/20172305TX.git
git@gitee.com:CS-IMIS-23/20172305TX.git
CS-IMIS-23
20172305TX
20172305TX
master

搜索帮助