expressionevaluatetestdata.java

来自「<算法导论>第二版大部分算法实现. 1. 各类排序和顺序统计学相关」· Java 代码 · 共 133 行

JAVA
133
字号
/* * Copyright (C) 2003-2008 Wang Pengcheng <wpc0000@gmail.com> * Permission is granted to copy, distribute and/or modify this * document under the terms of the GNU Free Documentation License, * Version 2.0 or any later version published by the Free Software Foundation; * with no Invariant Sections. * You may obtain a copy of the License at *   http://www.gnu.org/licenses/lgpl.txt *///25 Feb 2008package cn.edu.whu.iss.algorithm.unit10.test;public interface ExpressionEvaluateTestData {	String[] EXPR = {			"5",			"-1",			"100",			"-199",			"5+6",			"5-6",			"11+11",			"5*6",			"6/2",			"5/2",			"1/3",			"-5*6",			"-50*6",			"5*(-6)",			"(-7)*3",			"5+(-15)",			"5+6*7",			"5+6*7+8",			"5+(-6*7)+8",			"5+(6)+7",			"5.6*10",			"5.6*0.3",			"5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*10",			"1+2*30-4",			"6+8*12.0+8/4",			"100+(1+5)",			"((100+1+5))",			"9+9+4+6+9+1-9-5-1-(8-7)",			"6-(6-(9-(9-(8-(5+8)))))-(11-5)+11+1+5+11",			"9999+9999+9999+9999-(9999+9999+9999+9999)+25+5",			"12-(12+1)+1+1+5+12-12+6-6+12-(8-8)",			"((1+5)-1-8-7-(5-(8+7))-(9999-9990)-3)",			"6+9+8+5+9+2+4+1+8+3+9+3+8+3+7+8-6-8+9+4+1+1+7+6+1",			"10^4",			"(3+1+5)^3+1",			"3*(5+6)",			"(3+1+5)*(3^2+1^2+5^2-(1-2*3*1-1)+2*5*(3+1))",			"(3+1)^3+3*((3+1)^2)*5+3*(3+1)*5*5+(((3+1)^3)^1)",			"9999+((6^1)^10)-11*101*9-((6^2)^5)-((1-3-1-5-1)^3)-1",			"(3+3*(1+5))*(3^2)+((1+5)*2*(1+5)+(1+5)^2)*3+(1+5)^3+5",			"(3.85+3*(1+5))*(3^2)+((1+5)*2*(1+5)+(1+5)^2)*3+(1+5)^3+5.6",			"((12-6)^3)^3",			"(6+1+5)*(6^2+1^2+5^2-(1-2*6*1-1)+2*5*(6+1))",			"12+6+9+8+5+9+2+4+1+8+3+9+3+9+8+7-8-6+8+9+4+1+1+7+6",			"((12^1)^2)^3",			"(6+3*(1+5))*(6^2)+((1+5)*2*(1+5)+(1+5)^2)*6+(1+5)^3",			"((12^2-2*12*6+6^1*(6^1))^5)^10",			"((((12+6)^2-4*12*6))^10)^5+((((((12-12)^10)^10)^10)^10)^10)^10+10",			"((12^3-3*12*6*(12-6)-6^3)^4)^8*((12^2-2*12*6+6^2)^2)+100",			"1+(3-8)^3",			"1+(4-2)^(4-1)+0.5",			//the new is ok			"2^2^2+0.123",			"9999+6^10-11*101*9-6^2^5-(1-6-1-5-1)^3",			"(6+1+5)*(6^2+1^2+5^2-(1-2*6*1-1)+2*5*(6+1))",			"6^1^10-11*101*9-6^2^5-(1-3-1-5-1)^3",			".3",			".3+1"};	String[] ANS = {			"5",			"-1",			"100",			"-199",			"11",			"-1",			"22",			"30",			"3",			"2.5",			"0.3333333333",			"-30",			"-300",			"-30",			"-21",			"-10",			"47",			"55",			"-29",			"18",			"56.0",			"1.68",			"50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",			"57",			"104.0",			"106",			"106",			"22",			"17",			"30",			"18",			"-12",			"108",			"10000",			"730",			"33",			"729",			"668",			"728",			"734",			"742.25",			"10077696",			"1728",			"125",			"2985984",			"1728",			"653318623500070906096690267158057820537143710472954871543071966369497141477376",			"653318623500070906096690267158057820537143710472954871543071966369497141477386",			"653318623500070906096690267158057820537143710472954871543071966369497141477476",			"-124",			"9.5",			"16.123",			"-7958661109946400823924032",			"1728",			"-7958661109946400884401200",			".3",			"1.3"};}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?