simonradev

Condensed

Nov 8th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace simonEpedal
  5. {
  6.     class Program
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             int[] array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  11.            
  12.             for (int sumElement = 0; sumElement < array.Length - 1; sumElement++)
  13.             {
  14.                 for (int currentElement = 0; currentElement < array.Length - 1; currentElement++)
  15.                 {
  16.                     array[currentElement] = array[currentElement] + array[currentElement + 1];
  17.                 }
  18.             }
  19.            
  20.             Console.WriteLine(array[0]);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment