Guest User

Untitled

a guest
May 27th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. dataGridView1.RowCount = Convert.ToInt16(numericUpDown1.Value);
  4. }
  5.  
  6. private void button2_Click(object sender, EventArgs e)
  7. {
  8. int n = Convert.ToInt16(numericUpDown1.Value);
  9. double[] a = new double[n];
  10. for (int i = 0; i < n; i++)
  11. {
  12. a[i] = Convert.ToDouble(dataGridView1.Rows[i].Cells[0].Value);
  13. }
  14. double v = a[0];
  15. for (int i = 0; i < n; i++)
  16. if (a[i] > 0)
  17. {
  18. v = v + a[i];
  19. }
  20.  
  21. double v = a[0];
  22. for (int i = 0; i < n; i++)
Add Comment
Please, Sign In to add comment