Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string input = Console.ReadLine();
- string[] tokens = input.Split(' ');
- int[] masiv = Array.ConvertAll<string, int>(tokens, int.Parse);
- int a = masiv.Length / 2;
- if (masiv.Length == 1)
- {
- Console.WriteLine("{0 }", masiv[0]);
- }
- else if (masiv.Length%2 == 0)
- {
- Console.Write("{0 } ", masiv[a - 1]);
- Console.Write("{0 } ", masiv[a]);
- }
- else
- {
- Console.Write("{0 } ", masiv[a - 1]);
- Console.Write("{0 } ", masiv[a]);
- Console.Write("{0 } ", masiv[a + 1]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement