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