本文介绍了将文本文件读入数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!我知道可以使用嵌套for循环或其他东西来读取数组并将其打印到文本文件中。是否也可以读入文本文件然后将值放在数组中?谢谢!

解决方案




很酷!我想读取一个名为file.txt的文件,该文件由N行和N列填充值。我需要一个数组[N] [N]然后我可以在代码中使用。



Hi ! I know it''s possible to use a nested for loop or something to read an array and print it into a text file. Is it also possible to read in a text file and then put the values in an array ? Thanks !

解决方案


Cool ! I want to read in a file called file.txt which consists of N rows and N columns filled with values. I will need an array[N][N] that I can then use in code.



这篇关于将文本文件读入数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 20:41
查看更多