Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- using System.Text;
- using System.Linq;
- namespace _01._Furniture
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- var command = Console.ReadLine().Split().ToArray();
- while (command[0] != "For")
- {
- if (command[0] == "GladiatorStance")
- {
- input = input.ToUpper();
- Console.WriteLine(input);
- }
- else if (command[0] == "DefensiveStance")
- {
- input = input.ToLower();
- Console.WriteLine(input);
- }
- else if (command[0] == "Dispel")
- {
- int index = int.Parse(command[1]);
- char[] chars = input.ToCharArray();
- if (index >= 0 && index < chars.Length)
- {
- chars[index] = char.Parse(command[2]);
- input = new string(chars);
- Console.WriteLine("Success!");
- }
- else
- {
- Console.WriteLine("Dispel too weak.");
- }
- }
- else if (command[0] == "Target")
- {
- if (command[1] == "Change")
- {
- input = input.Replace(command[2], command[3]);
- Console.WriteLine(input);
- }
- if (command[1] == "Remove")
- {
- input = input.Replace(command[2], "");
- Console.WriteLine(input);
- }
- }
- else
- {
- Console.WriteLine("Command doesn't exist!");
- }
- command = Console.ReadLine().Split().ToArray();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement