Horje
c# fold sum array Code Example
c# fold sum array
int[] sequence = Console.ReadLine().Split().Select(int.Parse).ToArray();

int middleStartIndex = sequence.Length / 4;
int middleEndIndex = middleStartIndex + sequence.Length / 2;

int summingIndex = middleStartIndex - 1;

for (int i = middleStartIndex; i < middleEndIndex; i++)
{
  int sum = sequence[i] + sequence[summingIndex];
  Console.Write($"{sum} ");
  summingIndex--;
  if (summingIndex < 0)
  {
    summingIndex = sequence.Length - 1;
  }
}
Source: github.com




Csharp

Related
how to store more precise data then float c# Code Example how to store more precise data then float c# Code Example
what is reflection in programming Code Example what is reflection in programming Code Example
degree between two points latitude longitude c# Code Example degree between two points latitude longitude c# Code Example
find label controls in c# Code Example find label controls in c# Code Example
VideoPlayer.isPlaying Code Example VideoPlayer.isPlaying Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9