| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Text; |
| using System.Threading.Tasks; |
| using System.IO; |
| |
| namespace Dfm_test |
| { |
| class Program |
| { |
| static void Main(string[] args) |
| { |
| //byte[] mdstr = new byte[10000]; |
| //string mdstr = Console.ReadLine(); |
| //string mdinput = " "; |
| try |
| { |
| |
| /* |
| // 读取文件的源路径及其读取流 |
| string strReadFilePath = @"E:\Docfx\test\Dfm_test\Dfm_test\README.md"; |
| StreamReader srReadFile = new StreamReader(strReadFilePath); |
| // 读取流直至文件末尾结束 |
| while (!srReadFile.EndOfStream) |
| { |
| mdinput += srReadFile.ReadLine() ; //读取每行数据 |
| mdinput += "\n"; |
| //Console.WriteLine(strReadLine); //屏幕打印每行数据 |
| } |
| // 关闭读取流文件 |
| srReadFile.Close(); |
| |
| //string mdinput = mdstr.ToString(); |
| |
| string mdout = Microsoft.DocAsCode.Dfm.DocfxFlavoredMarked.Markup(mdinput); |
| |
| Console.Write(mdout);*/ |
| |
| while (true) |
| { |
| string tmp = Console.ReadLine(); |
| //Console.WriteLine(tmp + '\n'); |
| int num_of_row = System.Convert.ToInt32(tmp); |
| string str = ""; |
| for (int i = 0; i < num_of_row; i++) |
| { |
| tmp = Console.ReadLine(); |
| //Console.WriteLine(tmp + '\n'); |
| str += tmp; |
| str += "\r\n"; |
| } |
| string[] stringSeparators = new string[] { "\n" }; |
| //Console.WriteLine(str.Split(stringSeparators,StringSplitOptions.None).Length.ToString() + '\n'); |
| //Console.Write(str); |
| string mdout = Microsoft.DocAsCode.Dfm.DocfxFlavoredMarked.Markup(str); |
| int num_of_result = mdout.Split(stringSeparators , StringSplitOptions.None).Length; |
| //Console.WriteLine(num_of_result.ToString() + '\n'); |
| Console.Write(mdout + '\n'); |
| } |
| /* |
| Stream inputstream = Console.OpenStandardInput(); |
| Byte []datas = new Byte[1000]; |
| int length = inputstream.Read(datas , 0 , 1000); |
| char[] chars = Encoding.UTF7.GetChars(datas, 0, length); |
| Console.Write(chars.ToString());*/ |
| // string temp = ""; |
| |
| |
| /* |
| while ((temp = Console.ReadLine()) != null) |
| { |
| str += temp; |
| str += "\r\n"; |
| }*/ |
| |
| //Console.Write(str); |
| |
| } |
| catch (IOException e) |
| { |
| Console.WriteLine(" error"); |
| Console.WriteLine(e.ToString()); |
| Console.ReadKey(); |
| return; |
| } |
| |
| |
| } |
| } |
| } |