如何解析出图形形式的数字网格?
假设所有网格都可以包含 1 到 99 之间的任意数字,那么识别每个数字的最简单方法是什么?
例如:
-------------
| 1 | 2 | 3 |
|-----------|
|11 | 12| 13|
|-----------|
|4 | 5 | 6 |
|-----------|
如何将它们解析为二维数组?语言并不重要,我只想得到一个通用的解决方案。
谢谢,
Assuming all the grids can contain any number from 1 to 99 in each, what's the simplest way to recognize each number?
For example:
-------------
| 1 | 2 | 3 |
|-----------|
|11 | 12| 13|
|-----------|
|4 | 5 | 6 |
|-----------|
How do I parse them into a 2 dimensional array? Language doesn't matter, I just want to get a general solution.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您知道这是格式,我会使用正则表达式或简单的字符串分割
perl 中的示例:
REGEX:
STRING OPS:
或类似的东西。
If you know that to be the format I would go with either regex or simple string splitting
Examples in perl:
REGEX:
STRING OPS:
Or something to that effect.