Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1.  static void Main(string[] args)
  2.         {
  3.  
  4.             StreamReader read = new StreamReader("C:\\...\\new_file.txt");
  5.             string max = read.ReadLine();
  6.             while (!read.EndOfStream)
  7.             {
  8.                 string s = read.ReadLine();
  9.  
  10.                 if (max.Length < s.Length)
  11.                 {
  12.                     max = s;
  13.                 }
  14.             }
  15.             read.Close();
  16.             Console.WriteLine(max.Length);
  17.            
  18.  
  19.            
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement