#include<iostream.h>
#include<time.h>
#include<windows.h>
class klasa
{
      protected:
                long int a,b,wynik;
                char *napis;
      public:
             klasa(){a=rand(); b=rand(); napis="Przykladowy napis";};
             int funkcja1();
             virtual int funkcja2();
};

int klasa::funkcja1()
{
    cout<<"Przykladowy tekst";
    for(int i=0;i<100;i++)
    {
    int wynik=wynik*a*b*i;
    }
    return wynik;
}
int klasa::funkcja2()
{
    cout<<"Przykladowy tekst";
    for(int i=0;i<100;i++)
    {
    int wynik=wynik*a*b*i;
    }
    return wynik;
}

class klasa_potomna: public klasa
{
      int funkcja2();
};
int klasa_potomna::funkcja2()
{
    cout<<"Przykladowy tekst";
    int d=a*b/(a+b)-(b*b);
    return d;
}

      
int main()
{
    srand(time(NULL));
    long int start, stop;
    klasa *a=new klasa;
    start=clock();
    a->funkcja1();
    stop=clock();
    cout<<"\n"<<start<<"\t"<<stop<<endl;
    klasa *b=new klasa_potomna;
    start=clock();
    a->funkcja2();
    stop=clock();
    cout<<"\n"<<start<<"\t"<<stop<<endl;
    system("pause");
    return 0;
}
