Advertisement
Guest User

body

a guest
Mar 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include<iostream>
  2. #include "header.h"
  3. using namespace std;
  4. Polynomial::Polynomial(unsigned int w)//konstruktor ustawia
  5. {
  6.     stopien=w;
  7.     //wspol=new double[w+1];
  8. }
  9. Polynomial::~Polynomial()
  10. {
  11.     delete wspol;
  12.  
  13. }
  14. void Polynomial::wczytaj()
  15. {
  16.     cout<<"podaj stopien wielomianu: "<<endl;
  17.     cin>>stopien;
  18.     //obsluga bledow
  19. }
  20. void Polynomial::wspolczynniki(int n, double wspol)//wspol to adres tablicy
  21. {
  22.     int i;
  23.     double lol;
  24.     for(i=0; i<n; i++)
  25.     {
  26.         cout<<"podaj "<<i+1<<" wspolczynnik: "<<endl;
  27.         cin>>lol;
  28.         wspol[i]=lol;
  29.     }
  30. }
  31. void Polynomial::wypisz(int n, double wspol)
  32. {
  33.     int i;
  34.     cout<<"Mistrzuniu ty! Otrzymales wielomian ";
  35.     for(i=0; i<n; i++)
  36.     {
  37.         cout<<"("<<wspol[i]<<")x^"<<(n+1)-i<<"+";
  38.     }
  39.     cout<<"("<<wspol[n]<<") :D";
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement