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;
- namespace Arrays_MoreEx
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] arr = Console.ReadLine().Split(' ');
- int n = int.Parse(Console.ReadLine());
- for (int i = 0; i < n; i++)
- {
- string[] input = Console.ReadLine().Split(' ');
- string command = input[0];
- switch(command)
- {
- case "Reverse":
- Array.Reverse(arr);
- break;
- case "Distinct":
- arr = arr.Distinct().ToArray();
- break;
- case "Replace":
- int index = int.Parse(input[1]);
- arr[index] = input[2];
- break;
- }
- }
- Console.Write(string.Join(", ", arr));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement