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