Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include "header.h"
- using namespace std;
- Polynomial::Polynomial(unsigned int w)//konstruktor ustawia
- {
- stopien=w;
- //wspol=new double[w+1];
- }
- Polynomial::~Polynomial()
- {
- delete wspol;
- }
- void Polynomial::wczytaj()
- {
- cout<<"podaj stopien wielomianu: "<<endl;
- cin>>stopien;
- //obsluga bledow
- }
- void Polynomial::wspolczynniki(int n, double wspol)//wspol to adres tablicy
- {
- int i;
- double lol;
- for(i=0; i<n; i++)
- {
- cout<<"podaj "<<i+1<<" wspolczynnik: "<<endl;
- cin>>lol;
- wspol[i]=lol;
- }
- }
- void Polynomial::wypisz(int n, double wspol)
- {
- int i;
- cout<<"Mistrzuniu ty! Otrzymales wielomian ";
- for(i=0; i<n; i++)
- {
- cout<<"("<<wspol[i]<<")x^"<<(n+1)-i<<"+";
- }
- cout<<"("<<wspol[n]<<") :D";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement