Exemplo n.º 1
0
        static public MassiveClass ReadFile(string path, char separator = ' ')
        {
            MassiveClass result = new MassiveClass();
            string       str    = "";
            bool         flag;
            int          x, resIndex = 0;

            str = Maxyber.FileToString(path);
            string[] strMas = str.Split(separator);
            for (int i = 1; i < strMas.Length; i++)
            {
                do
                {
                    flag = int.TryParse(strMas[i], out x);
                    if (flag == true)
                    {
                        result.Set(resIndex, strMas[i]);
                        resIndex++;
                        if (resIndex >= result.GetLength)
                        {
                            result.Resize();
                        }
                    }
                    else
                    {
                        i++;
                    }
                } while ((flag != true) && (i < strMas.Length));
            }
            return(result);
        }
Exemplo n.º 2
0
        public MassiveClass Inverse()
        {
            MassiveClass res = new MassiveClass();

            for (int i = 0; i < index; i++)
            {
                res.Set(i, -1 * massive[i] + "");
            }
            return(res);
        }