#include <iostream>
class Screen {
friend std::istream& operator>>( std::istream&, Screen& );
friend std::ostream& operator<<( std::ostream&, const Screen& );
public:
Screen(int width, int height)
: _width(width), _height(height) {}
private:
int _width;
int _height;
};
std::ostream& operator<<( std::ostream& os, const Screen& s )
{
os << "height = " << s._height << "\n";
os << "width = " << s._width << "\n";
return os;
}
std::istream& operator>>( std::istream& is, Screen& s )
{
std::cout << "Enter height and width: ";
is >> s._height >> s._width;
return is;
}
int main() {
Screen s(1,2);
std::cout << s;
std::cin >> s;
std::cout << s;
return 0;
}