#include<iostream.h>
class Sample
{
int x,y;
public:
Sample(){x=y=0;}
Sample(int i,int j){x=i;y=j;}
void copy(Sample & s);
void setxy(int i,int j){x=i;y=j;}
void print(){cout<<"x="<<x<<",y="<<y<<endl;}
};
void Sample::copy (____________)
{
x=s.x;y=s.y;
}
void func(____________)
)
{
s1.setxy(10,20);
s2.setxy(30,40);
}
void main()
{
Sample p(1,2),q;
q.copy(p);
func(p,q);
p.print();
q.print();
}
Sample&s
}
第1空:SAMPLE &S
第2空:SAMPLE S1,SAMPLE &S2