//定义学生信息结构体
public struct Person
{
//外部要使用这里面的变量,需要加上public
public string _name;
public int _age;
public Gender _gender;
}
//定义性别枚举类型
public enum Gender
{
男,
女
}
class Program
{
static void Main(string[] args)
{
//创建张三信息
Person zsPenson;
zsPenson._name = \”张三\”;
zsPenson._age = 19;
zsPenson._gender = Gender.男;
//创建李四信息
Person lsPerson;
lsPerson._name = \”李四\”;
lsPerson._age = 21;
lsPerson._gender = Gender.女;
Console.WriteLine(zsPenson._name);
Console.WriteLine(lsPerson._name);
Console.Read();
}
}