110,538
社区成员
发帖
与我相关
我的任务
分享
double[] arr = System.IO.File.ReadAllLines(@"e:/Test.txt", System.Text.Encoding.Default).Select(p => double.Parse(p.Trim())).ToArray();
int[] arr = System.IO.File.ReadAllLines(@"e:/Test.txt", System.Text.Encoding.Default).Select(p=>int.Parse(p.Trim())).ToArray();
//譬如第三行的数字:arr[2];
满意就结贴string[] lines = File.ReadAllLines("your path");//如果判断范围少的话,也可以循环一行行读取
int y;
string x;
if (y < 100)
{
x = lines[0];
}
else if (y >= 100 && y < 200)
{
x = lines[2];
}
//感觉你这个比喻不就是整除100嘛……