Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- List<long>numbers = Console.ReadLine().Split().Select(long.Parse).ToList();
- List<long>result = new List<long>();
- for (int i=0; i<numbers.Count/2; i++)
- {
- long firstNum = numbers[i];
- long lastNum = numbers[numbers.Count-1-i];
- result.Add(firstNum+lastNum);
- }
- if (numbers.Count%2==1)
- {
- result.Add(numbers[numbers.Count/2]);
- }
- Console.WriteLine(string.Join(" ",result));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement