struct Student
{
private string sno;
private string sname;
private char sex;
private float score;
public Student(string sno, string sname, char sex, float score)
{
this.sno = sno;
this.sname = sname;
this.sex = sex;
this.score=score;
}
public String SNo
{ get; }
public Char Sname
{ get; }
public String Sex
{ get; }
public Float Score
{ get; }
}
static void Main(string[] args)
{
Student s1 = new Student("201610236", "小明", 'M', 97.6);
Console.WriteLine("{0}-{1}-{2}-{3}",s1.SNo,s1.Sname,s1.Sex,s1.Score);
Console.Read();
}
追问谢谢