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.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace _09_MelrahShake
- {
- class MelrahShake
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine();
- string pattern = Console.ReadLine();
- text = text.Remove(text.IndexOf(pattern), pattern.Length);
- text = text.Remove(text.LastIndexOf(pattern), pattern.Length);
- Console.WriteLine("Shaked it.");
- pattern = pattern.Remove(pattern.Length/2, 1);
- if (text.IndexOf(pattern) > 0)
- {
- text = text.Remove(text.IndexOf(pattern), pattern.Length);
- text = text.Remove(text.LastIndexOf(pattern), pattern.Length);
- }
- else
- {
- Console.WriteLine("No shake.");
- }
- Console.WriteLine(text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement