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