示例#1
0
        static void Main(string[] args)
        {
            int    a   = 16;
            string qwe = "sdfsd";

            Console.WriteLine(qwe.GetType());
            int     b    = 16;
            Student yan  = new Student("yan", "bgtu", 18);
            Student non  = new Student();
            Student yan1 = new Student(yan);
            Student qw1  = new Student("qwe", "wer", 1);
            Student qw2  = new Student("ccc", "dsf", 6);

            yan.print();
            non.print();
            yan1.print();
            Console.WriteLine(yan.Equals(yan1));
            Console.WriteLine(yan.Equals(non));
            Console.WriteLine(Student.count);
            Console.WriteLine(Student.polovina());
            Console.WriteLine(yan1.ToString());
            Console.WriteLine(yan1.type);
            yan.ageout(out a);
            Console.WriteLine(a);
            yan.changeage(ref b);
            yan.print();
            yan.part();
            var stud = new { name = "kek", edu = "lol", age = 10 };

            List <Student> list1 = new List <Student>();

            list1.Add(yan);
            list1.Add(qw1);
            list1.Add(yan1);
            list1.Add(qw2);
            string poisk = Console.ReadLine();

            foreach (var item in list1)
            {
                if (item.name == poisk)
                {
                    Console.WriteLine("pobeda");
                }
                else
                {
                    Console.WriteLine("ne pobeda");
                }
            }


            BuildCollection <Student> Col = new BuildCollection <Student>(10);

            Col.Add(yan);
            Col.Get(0);
            Col.Add(yan1);
            Col.Add(yan1);
            Console.WriteLine(Col.Count);
            Col.Remove(yan);
            Console.WriteLine(Col.Count);
            Console.WriteLine(Col.Contains(yan1));
        }