帕斯卡将线分割为实数和字符串
我知道这种语言几年前就已经消失了,但我们国家的大多数学校仍然需要 -.- 我得到了包含数据的文件,如下所示:
- 行数 姓名
- 姓氏(真实类型数字)(另一个真实类型数字)
例如
- 2
- Brat Sunbather 5.66 55.4
- Bart Simpson 55.7 45.4
我需要创建结果文件,如下所示:
- 姓名(之前给出的真实数字相乘)
- 总计
例如
- Brat Sunbather 313.56
- Bart Simpson 2528.78
- 总计:2842.34
我一直试图将行拆分为字符串和实数,即使在我在示例中给出的书中,所有数据都在单独的行上:
- String
- Digit
- String
- Digit
我在网上找不到任何内容希望你能帮助我。先感谢您。
I know that this language have died a couple of years ago, but still required in most of schools in our country -.-
I got file with data, which looks like:
- Number of lines
- Name Surname (real type digit) (another real type digit)
For e.g.
- 2
- Brat Sunbather 5.66 55.4
- Bart Simpson 55.7 45.4
And I need to create result file, which looks like this:
- Name Surname (Previously given real type digits multiplied)
- Total
For e.g.
- Brat Sunbather 313.56
- Bart Simpson 2528.78
- Total: 2842.34
I'm stuck in trying to split the line into string and real, even in the book I've given in the examples all data is on separate line:
- String
- Digit
- String
- Digit
I can't find anything on the net and hope you could help me. Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以帮助您开始 - 我已经阅读了文件,分割了行,并将字符串转换为实数:
This should get you started - I got as far as reading the file, splitting the line, and converting the strings to reals: