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