Fluttershy using System using System Collections Generic using System

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Fluttershy :3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
FileStream file = new FileStream("..//..//tes.txt", FileMode.Open);
StreamReader sr = new StreamReader(file);
int buff = 0;
int temp = 0;
int numb = 0;
for(int i = 1;; i++)
{
temp = sr.ReadLine().Length;
if (temp > buff)
{
buff = temp;
numb = i;
}
if(sr.EndOfStream)
break;
}
sr.Close();
Console.WriteLine("Size - \t\t" + buff);
Console.WriteLine("Position - \t" + numb);
Console.ReadKey();
}
}
}