AddO1f

Seti_1

Apr 2nd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4.  
  5. class Program
  6. {
  7.     static void Main(string[] args)
  8.     {
  9.         StreamReader sr = File.OpenText("test.txt");
  10.         string k = null;
  11.         string input = Console.ReadLine();
  12.         for(;(k=sr.ReadLine())!=null;)
  13.         {
  14.             if (k.Contains(input)) { Console.WriteLine(k); break; }
  15.         }
  16.         if (k==null) { Console.WriteLine("Not found!"); }            
  17.         sr.Close();
  18.         Console.ReadKey();
  19.     }
  20. }
Add Comment
Please, Sign In to add comment