SHARE
TWEET

Untitled

a guest Apr 18th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. istream &operator >>(istream &cin, Kompleksni &a) {
  2.  char znak;
  3.  cin >> ws; // "Progutaj" razmake
  4.  if(cin.peek() != '(') {
  5.  cin >> a.re;
  6.  a.im = 0;
  7.  }
  8.  else {
  9.  cin >> znak >> a.re >> znak;
  10.  if(znak != ',') cin.setstate(ios::failbit);
  11.  cin >> a.im >> znak;
  12.  if(znak != ')') cin.setstate(ios::failbit);
  13.  }
  14.  return cin;
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top