Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- namespace ConsoleApp10
- {
- class Program
- {
- private static void Main()
- {
- string[] lines = File.ReadAllLines("dictionary.txt");
- HashSet<string> dictionary = new HashSet<string>(lines);
- IEnumerator<string> data;
- data = File.ReadLines("text.txt").GetEnumerator();
- var html = new FileStream("ansver.html", FileMode.Create);
- while (data.MoveNext())
- {
- if (data.Current == null) continue;
- foreach (string word in data.Current.Split(' '))
- {
- if (dictionary.Contains(word))
- {
- yield return "<b><i>" + word + "</i></b>";
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement