title: Calculate (complicated) array of decimal numbers in C#
body: <p>I have a listbox where users can enter decimal numbers. Let's say they'll enter 5 numbers:</p>
  
  <pre><code>1.1
  1.2
  1.3
  1.4 
  1.5
  </code></pre>
  
  <p>I need to get the sum of all the variations in those 5 numbers. For example sum of <code>1.1 and 1.2</code> then <code>1.1 1.2 1.3</code> then <code>1.1 1.2 1.3 1.4</code>, then <code>1.2 1.4 1.5</code> then <code>1.1 1.3 1.5</code>.</p>
  
  <p>I started something but that goes through all the variations only skipping one number at a time:</p>
  
  <pre><code>List&lt;Double[]&gt; listNumber = new List&lt;double[]&gt;();            
  Double[] array;            
  for (int i = 0; i &lt; listBox1.Items.Count; i++)
  {
      array = new Double[listBox1.Items.Count];                
      for (int k = 0; k &lt; listBox1.Items.Count; k++)
      {
          if (!k.Equals(i))
          {
              array[k] = (Convert.ToDouble(listBox1.Items[k]));                       
          }
      }
      listNumber.Add(array);
  }   
  </code></pre>
  
  <p>I need to find a way how to calculate the way I want.</p>