private void button2_Click_1(object sender, EventArgs e)
{
string[] s = textBox1.Text.Split(',');
int[] a = new int[s.Length];
try
{
for (int i = 0; i < s.Length; i++)
a[i] = Convert.ToInt32(s[i]);
}
catch (Exception ex)
{
textBox2.Text = ex.Message;
}
for (int i = 1; i < a.Length; i++)
for (int j = i; j < a.Length - 1; j++)
if (a[j - 1] > a[j])
{
int t = a[j - 1];a[j - 1] = a[j];a[j] = t;
}
textBox2.Text += "list: ";
foreach (int t in a)
textBox2.Text += string.Format("{0}",t);
}