Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Lab_7
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr1 = Console.ReadLine()
- .Split()
- .Select(int.Parse)
- .ToArray();
- int[] condensed = new int[arr1.Length - 1];
- while (true)
- {
- for (int i = 0; i < condensed.Length - 1; i++)
- {
- condensed[i] = arr1[i] + arr1[i + 1];
- }
- arr1 = condensed;
- if (arr1.Length == 1)
- { Console.WriteLine(arr1[0]);
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement