萌新求助!萌新求助!萌新求助!

我来了呀! 2019-05-26 06:38:02
<?xml version="1.0" encoding="utf-8"?>
<test>
<env mis="on" err="off" ans="off">
<info>
(hold 0) (at 0 3)
(sort 1 chair) (size 1 big) (at 1 1)
(sort 2 plant) (size 2 big) (at 2 2)
(sort 3 sofa) (size 3 big) (at 3 3)
(sort 4 worktable) (size 4 big) (at 4 4)
(sort 5 couch) (size 5 big) (at 5 5)
(sort 6 table) (size 6 big) (at 6 6)
(sort 7 teapoy) (size 7 big) (at 7 7)
(sort 8 airconditioner) (size 8 big) (at 8 8)
(sort 9 table) (size 9 big) (at 9 9)
(sort 10 television) (size 10 big) (at 10 10)
(sort 11 book) (size 11 small)
(sort 12 remotecontrol) (size 12 small) (color 12 yellow) (at 12 7)
(sort 13 can) (size 13 small) (color 13 green) (plate 13)
(sort 14 remotecontrol) (size 14 small) (color 14 black)
(sort 15 can) (color 15 blue) (size 15 small)
(sort 16 remotecontrol) (size 16 small) (color 16 red)
(sort 17 cup) (size 17 small) (at 17 10)
(sort 18 can) (size 18 small) (color 18 white)
(sort 19 book) (size 19 small) (color 19 blue) (at 19 9)
</info>
<mis>
(at 11 7)
</mis>
<err>
<r>(at 14 3) (at 15 1) (at 16 2) (at 18 4)</r>
<w>(at 14 9) (at 15 7) (at 16 6) (at 18 6)</w>
</err>
<extra>
</extra>
</env>
<instr>
(:ins
(:task (pickup X) (:cond (sort X remotecontrol)))
(:task (pickup X) (:cond (color X black) (sort X remotecontrol)))
(:task (puton X Y) (:cond (sort X can) (sort Y worktable)))
(:task (puton X Y) (:cond (sort X cup) (sort Y worktable)))
(:task (goto X) (:cond (sort X chair)))
(:cons_notnot (:info (on X Y) (:cond (sort X remotecontrol) (color X yellow) (sort Y teapoy))))
)
</instr>
<nl>
Pick up a remotecontrol.
Pick up the remotecontrol which is black.
Put a can on the worktable.
Put a cup on the worktable.
Go to chair.
The green can must be on the plate.
The remotecontrol which is yellow must be on the teapoy.
</nl>
</test>
萌新求助!
在仿真语言中,
请问,如何在<nl>到</nl>中进行关键字读取?
请问,如何在<instr>到</instr>中进行关键字读取?
...全文
60 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
六道佩恩 2019-05-27
  • 打赏
  • 举报
回复
可以先读入一个字符数组 遍历判断,当判断到一个<nl>的时候,记录下位置,然后判断到</nl>的时候再次记录下位置,然后你读取时只要判断再在这两个位置之间就行了。 要方便点的话,可以用正则表达式相关的函数,比如regcomp、regexec、regfree、regerror 我说的是把上面这段文字用C语言读取的办法,不知道是不是你要的
我来了呀! 2019-05-26
  • 打赏
  • 举报
回复
请问,具体可以怎么做呢!
Intel0011 2019-05-26
  • 打赏
  • 举报
回复
使用TinyXML库解析

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧