Guest User

Untitled

a guest
Oct 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. friend ostream &operator << (ostream &cout, const Polinom &P1)
  2. {
  3. for (int i(0); i<=P1.koeficienti.size(); i++)
  4. {
  5. if (P1.koeficienti[i]==0) i++;
  6. if (i==0)
  7. {
  8. cout << P1.koeficienti[i] << " + ";
  9. }
  10. if (i==P1.koeficienti.size()-1)
  11. {
  12. cout << P1.koeficienti[i] << " " << "x^" << i;
  13. }
  14. if (i>0 && i<P1.koeficienti.size()-1)
  15. {
  16. cout << P1.koeficienti[i] << " " << "x^" << i << " + ";
  17. }
  18. }
  19. }
Add Comment
Please, Sign In to add comment