Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- friend istream& operator >> (istream& is, zFrac &r) {
- char ch;
- is >> r.num;
- auto fl = is.flags();
- is.unsetf(ios_base::skipws);
- is >> ch;
- if (ch == '/' || ch == '\\')
- is >> r.denom;
- else {
- is.putback(ch);
- r.denom = 1;
- }
- zFrac f;
- is.setf(ios_base::skipws);
- r.norm();
- return is;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement