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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- int lenght = input.Length;
- if (lenght == 1)
- {
- Console.WriteLine($"{{ {input[0]} }}");
- }
- else if (lenght % 2 == 0)
- {
- Console.WriteLine($"{{ {input[lenght/2-1]} {input[lenght / 2]} }}");
- }
- else
- {
- Console.WriteLine($"{{ {input[lenght / 2 - 1]} {input[lenght / 2]} {input[lenght / 2 + 1]} }}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment