Esempio n. 1
0
        private void func(String mas)
        {
            int_mas.Clear();
            if (mas[0] == ' ')
            {
                mas = mas.Remove(0, 1);
            }
            if (mas[mas.Length - 1] == ' ')
            {
                mas = mas.Remove(mas.Length - 1, 1);
            }
            String temp = "";

            for (int i = 0; i < mas.Length; i++)
            {
                if (mas[i] == ' ')
                {
                    int_mas.Add(int.Parse(temp));
                    temp = temp.Remove(0, temp.Length);
                }
                else
                {
                    temp += mas[i];
                    if (i == mas.Length - 1)
                    {
                        int_mas.Add(int.Parse(temp));
                        temp = temp.Remove(0, temp.Length);
                    }
                }
            }


            int_mas.Sort();
            mul = 0;
            for (int i = 0; i < int_mas.Count; i++)
            {
                mul += (int_mas[i]);
            }
            label2.Text = mas;
            remoteObj.adding_mul(mul);
        }