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