#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;
};
void fun(Student &s)
{
s.display();
s.change(101,80.5);
s.display();
}
int main()
{
void fun(Student&);
Student stud(101,78.5);
fun(stud);
return 0;
}第3章 第8题
最新推荐文章于 2024-06-17 14:50:48 发布
25万+

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



