java问题求解,望大虾指教

daqingzd daqingzd 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
2. Write a console application which load a XML file defined
below and write a text file as described above.

Typical usage : java -jar xml2calc.jar input.xml output.txt

XML Format :

<calc>
<op type=”TYPE”>
<first>
<op>...</op>
</first>
<second>
...
</second>
</op>
</calc>

<first>number | op</first>
<first value=”number”/>

Operation types : ”add” | “sub” | “mul” | “div”

Sample XML file :

<?xml version="1.0"?>
<calc>
<op type=”add”>
<first>
<op type=”div”>
<first>
<op type=”mul”>
<first value=”3”/>
<second value=”2”/>
</op>
</first>
<second value=”5”/>
</op>
</first>
<second value=”2”/>
</op>
</calc>

Sample output file :
3 * 2 / 5 + 2
...全文
评论 3
收藏 已收藏
分享
返回顶部
daqingzd
Java SE 62,621 成员 307,251 内容