代码拉取完成,页面将自动刷新
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();
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。