using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { public class student { public string name; public byte note; } class Program { static void Main(string[] args) { student[] students = new student[5]; Random rnd = new Random(); for (int i = 0; i < students.Length; i++) { students[i].note = (byte)rnd.Next(1, 6); students[i].name = "aaa"; } } } }