#include<bits/stdc++.h>
using namespace std;
class student{
public:
friend ostream& operator <<(ostream &os,const student&f);
friend istream& operator >>(istream& is,student&f);
string id;
string name;
char sex;
int age;
};
ostream& operator <<(ostream &os,const student&f)
{
os<<f.id<<" "<<f.name<<" "<<f.sex<<" "<<f.age<<endl;
}
istream& operator >>(istream& is,student&f)
{
is>>f.id>>f.name>>f.sex>>f.age;
}
int main()
{
student s;
cin>>s;
cout<<s;
return 0;
}
io流的重载必须定义为非成员函数,重载为类的友元函数!!!