当前位置:造化图小说网>科幻灵异>我的1979> 15、骂战
阅读设置(推荐配合 快捷键[F11] 进入全屏沉浸式阅读)

设置X

15、骂战(2 / 2)

054

s=(obj);

055

}

056

}else{

057

numberformatnumberformat=();

058

s=(obj);

059

}

060

}catch(exceptione){

061

}

062

retus;

063

}

064

065

070

publicstaticstringcomputestring(stringstring){

071

stringregexcheck=“[\\(\\)\\d\\+\\-\\*/\\]*“;是否是合法的表达式

072

073

if(!(regexcheck,string))

074

retustring;

075

076

matchermatcher=null;

077

stringtemp=““;

078

intindex=-1;

079

stringregex=“\\([\\d\\\\+\\-\\*/]+\\)“;提取括号表达式

080

string=(“\\s“,““);去除空格

081

try{

082

pattepatte=(regex);

083

循环计算所有括号里的表达式

084

while((string)()){

085

matcher=(string);

086

while(()){

087

temp=();

088

index=(temp);

089

string=(0,index)

090

+computestignobracket(temp)

091

+(index+());

092

}

093

}

094

最后计算总的表达式结果

095

string=computestignobracket(string);

096

}catch(numberformatexceptione){

097

();

(未完待续。)手机用户请浏览阅读,更优质的阅读体验。

上一页 目录 +书签 下一章