用C#编程 3.建立一个学生类,该学生类有学号、姓名、和考试成绩五个成员...

发布网友 发布时间:2024-10-24 02:25

我来回答

1个回答

热心网友 时间:2024-11-06 06:48

3.class Student
{
private string id;

public string Id
{
get { return id; }
set { id = value; }
}
private string name;

public string Name
{
get { return name; }
set { name = value; }
}
private string success;

public string Success
{
get { return success; }
set { success = value; }
}
public Student()
{

}
public Student(string id)
{
this.id = id;
}
}

4.public struct Student
{
public string id;
public string name;
public string success;
}
class MyClass
{
Student s;
public void Print()
{
s.id = "id";
s.name = "name";
s.success = "success";
Console.Write(s.id);
Console.Write(s.name);
Console.Write(s.success);
}
}
5。int temp = b;b=a;a=temp;
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com