Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- friend ostream &operator << (ostream &cout, const Polinom &P1)
- {
- for (int i(0); i<=P1.koeficienti.size(); i++)
- {
- if (P1.koeficienti[i]==0) i++;
- if (i==0)
- {
- cout << P1.koeficienti[i] << " + ";
- }
- if (i==P1.koeficienti.size()-1)
- {
- cout << P1.koeficienti[i] << " " << "x^" << i;
- }
- if (i>0 && i<P1.koeficienti.size()-1)
- {
- cout << P1.koeficienti[i] << " " << "x^" << i << " + ";
- }
- }
- }
Add Comment
Please, Sign In to add comment