Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class Program
- {
- static void Main()
- {
- string searchedWord = Console.ReadLine();
- string manySentences = Console.ReadLine();
- searchedWord.ToLower();
- manySentences.ToLower();
- string[] splittedSentences = manySentences.Split('.');
- for (int i = 0; i < splittedSentences.Length; i++)
- {
- string[] splittedSentencesBySpace = splittedSentences[i].Split(' ');
- for (int j = 0; j < splittedSentencesBySpace.Length; j++)
- {
- if (splittedSentencesBySpace[j] == searchedWord)
- {
- Console.Write(splittedSentences[i] + ".");
- continue;
- }
- for (int z = 0; z < splittedSentencesBySpace[j].Length; z++)
- {
- if (char.IsLetter(splittedSentencesBySpace[j][z]) == false)
- {
- string[] splitByNonLetterSymbol = splittedSentencesBySpace[j].Split(splittedSentencesBySpace[j][z]);
- for (int p = 0; p < splitByNonLetterSymbol.Length; p++)
- {
- if (splitByNonLetterSymbol[p] == searchedWord)
- {
- Console.Write(splittedSentences[i]+".");
- z = splittedSentencesBySpace[j].Length;
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement