示例#1
0
        private static void PopulateList(LinkedList <Student> lista)
        {
            Console.WriteLine("Cati studenti doriti sa introduceti in Lista? : ");
            int nrStudenti = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < nrStudenti; i++)
            {
                Student student = new Student();
                Console.WriteLine("Introduceti numele studentului " + " :");
                student.nume = Console.ReadLine();
                Console.WriteLine("Introduceti prenumele studentului " + " :");
                student.prenume = Console.ReadLine();
                Console.WriteLine("Introduceti grupa studentului " + " :");
                Grupa grup = new Grupa(Convert.ToInt32(Console.ReadLine()), nrStudenti);
                student.grupa = grup;
                lista.AddLast(student);
            }
        }
示例#2
0
 public Student(string nume, string prenume, Grupa grupa)
 {
     this.nume    = nume;
     this.prenume = prenume;
     this.grupa   = grupa;
 }