#include <iostream>
using namespace std;
class Student
{
public:
Student(int n,float s):num(n),score(s){}
void change(int n,float s)
{
num=n;
score=s;
}
void display()
{
cout<<num<<" "<<score<<endl;
}
private:
int num;
float score;
};
int main()
{
Student stud(101,78.5);
void fun(Student &);
fun(stud);
return 0;
}
void fun(Student &stu)
{
stu.display();
stu.change(101,80.5);
stu.display();
}
3-8
最新推荐文章于 2025-07-08 07:00:00 发布
1万+

被折叠的 条评论
为什么被折叠?



