Ejemplo n.º 1
0
        static void Main2(String[] args)
        {
            String title     = Console.ReadLine();
            String author    = Console.ReadLine();
            int    price     = Int32.Parse(Console.ReadLine());
            Book   new_novel = new MyBook(title, author, price);

            new_novel.display();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Titul knihy:");
            string title = Console.ReadLine();

            Console.WriteLine("Autor knihy:");
            string author = Console.ReadLine();

            Console.WriteLine("Cena knihy:");
            int  price     = Int32.Parse(Console.ReadLine());
            Book new_novel = new MyBook(title, author, price);

            new_novel.display();
            Console.ReadKey();
        }
Ejemplo n.º 3
0
        static void ArrayManuplate()
        {
            //int i = 10, j=20;
            //Pointers(ref i,ref j);

            var ay = new Book[4];// {1, 2, 3, 4};

            ay[1] = new MyBook("a", "b", 120);
            ay[3] = ay[1];

            int[, ,] arr =
            {
                {
                    {  1,  2,  3 },
                    {  4,  5,  6 }
                },
                {
                    { 11, 12, 13 },
                    { 14, 15, 16 }
                }
            };

            int rank = arr.Length;//.Rank;
            int lb   = arr.GetLowerBound(0);
            int ub   = arr.GetUpperBound(0);

            for (int k = 0; k < 2; k++)
            {
                for (int l = 0; l < 2; l++)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        arr[k, l, i] = k + l + i;
                    }
                }
            }

            int[] arrr = { 11, 2, 3, 4 };
            //var ar=Array.Find(arrr, a => a > 2);
            Array.Sort(arrr, new Comp());
            //Converter<int, string> con = null;
            //Array.ConvertAll<int,string>(arrr, con);
            string[] arrstr = { "abebe", "beso", "bela" };
            Array.Clear(arrstr, 0, arrstr.Length);

            var a = Array.CreateInstance(typeof(string), 3, 3);

            //Array.ForEach(arrr);

            //Array.Resize(ref arrr,2);

            Array.Reverse(arrr);

            IList <int> arList = new List <int>();

            arList = arrr.ToList();
            var arLi = arList.Select(l => l + 3).ToList();

            //return new int[0];
            //return new[] { 1, 2, 3, 4 };
            //Hashtable ht=new Hashtable();
            //Dictionary<string,int> dict=new Dictionary<string, int>(10);
        }