SHARE
TWEET

KOCEVTARIKATAMASIVI

a guest Oct 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int[] numbers = Console.ReadLine()
  2.                 .Split()
  3.                 .Select(int.Parse)
  4.                 .ToArray();
  5.  
  6.             while (numbers.Length > 1)
  7.             {
  8.                 int[] condensed = new int[numbers.Length - 1];
  9.  
  10.                 for (int i = 0; i < condensed.Length; i++)
  11.                 {
  12.                     condensed[i] = numbers[i] + numbers[i + 1];
  13.                 }
  14.                 numbers = condensed;
  15.             }
  16.             Console.WriteLine(string.Join(" ", numbers));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top