/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ClearButton_Click(object sender, EventArgs e) { InputTextBox.Clear(); OutputTextBox.Clear(); TimeBox.Clear(); CountText.Clear(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RandomButton_Click(object sender, EventArgs e) { InputTextBox.Clear(); OutputTextBox.Clear(); TimeBox.Clear(); CountText.Clear(); int n = rnd.Next(2, 20); int k = rnd.Next(1, n); string line = null; for (int i = 0; i < k; i++) { int temp1 = rnd.Next(1, n); int temp2 = rnd.Next(1, n); if (temp1 != temp2) { line += temp1 + " " + temp2 + "\n"; i++; } } if (line != null) { InputTextBox.Text = line.Trim(); } CountText.Text = n + " " + k; }