daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication24
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var text = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  14.             var sum = text.Take(text.Length / 4).Reverse().ToArray();
  15.             var sum2 = text.Reverse().Take(text.Length / 4).ToArray(); ;
  16.             var Secondrow = text.Skip(text.Length / 4).Take(text.Length / 2).ToArray(); ;
  17.           var Firstrow=sum.Concat(sum2).ToArray();
  18.           var last = new int[text.Length / 2];
  19.           for (int i = 0; i < last.Length; i++)
  20.           {
  21.               last[i] = Firstrow[i] + Secondrow[i];
  22.           }
  23.           Console.WriteLine(string.Join(" ",last));
  24.         }
  25.     }
  26. }
RAW Paste Data
Top