如何计算一个数字 [英] how to count to a single number

查看:92
本文介绍了如何计算一个数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何将5的值转换为= 0、1、2、3、4、5的数组.我有一个读取文件中多少行的代码,但是我需要将该实数更改为以0开头并在这种情况下为5的实数的列表或数组.帮助会很棒.从这个问题看来,您想要创建一个array or list的大小等于文件中的行数.如果目的是将文件中的每一行存储到此数组或列表中,则System.IO.File.ReadAllLines 方法在此处说明 http ://msdn.microsoft.com/zh-CN/library/s2tte0y1.aspx [ ^ ]
可以使用,通过创建大小等于文件中行数的数组将文件中的每一行读入数组.


  Dim  strHeaps =  10 

对于 i =  0   strHeaps 步骤  1 
    MsgBox(i& " )
下一个 


I need to know how i can turn a value of 5 into an array that = 0,1,2,3,4,5. I have a code that reads how many lines are in a file but i need to change that solid number in to a list or an array that starts with 0 and goes to the solid number in this case 5. help would be great.

解决方案

From the question it appears that you want to create an array or list of size equal to the number of lines in the file. If the purpose is to store each line from the file into this array or list then System.IO.File.ReadAllLines method explained here http://msdn.microsoft.com/en-us/library/s2tte0y1.aspx[^]
can be used, which reads each line from the file into the array by creating an array of size equal to the number of lines in the file.


Dim strHeaps = 10

For i = 0 To strHeaps Step 1
    MsgBox(i & " is the number were at")
Next


这篇关于如何计算一个数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆