using System;
using System.IO;
using System.Collections.Generic;
namespace Demo
{
class Program
{
static void Main(string[] args)
{
// 声明文件读取流并指定文件位置
StreamReader reader = new StreamReader(@"C:\Users\Administrator\Desktop\JiangXiaoBai.txt");
List<string> list = new List<string>(); // 声明装填单行文本的集合
string textLine = null;
while ((textLine = reader.ReadLine()) != null) // 循环读取
{
list.Add(textLine);
}
for (int i = 0; i < list.Count - 1; i++)
{
for (int j = 0; j < list.Count - 2; j++)
{
// 以 . 为节点截取序号对应的文本作为比较条件
int previous = int.Parse(list[j].Substring(0, list[j].IndexOf(".")));
int next = int.Parse(list[j + 1].Substring(0, list[j + 1].IndexOf(&
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交