Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class GraczKomputery;
- class Gracz
- {
- protected:
- int ilosc_gier;
- int *punkty;
- public:
- Gracz(int ilosc_gier1,int *punkty);
- ~Gracz();
- void Ustaw_Punkty(int ilosc_gier1, int *punkty);
- float Srednia(int, int);
- };
- class GraczKomputery :public Gracz
- {
- public:
- float trudnosc;
- GraczKomputery();
- void Ustaw(float trudnosc1);
- };
- int main()
- {
- Gracz *gr= new Gracz(3, 0);
- GraczKomputery komp();
- }
- Gracz::Gracz(int ilosc_gier1, int *punkty1)
- {
- ilosc_gier = ilosc_gier1;
- int *punkty = new int[ilosc_gier1];
- for (int i = 0; i < ilosc_gier1; i++)
- {
- punkty[i] = 0;
- }
- }
- Gracz::~Gracz()
- {
- delete[]punkty;
- }
- void Gracz::Ustaw_Punkty(int ilosc_gier1, int *punkty1)
- {
- ilosc_gier = ilosc_gier1;
- }
- float Gracz::Srednia(int, int)
- {
- return 0.0;
- }
- void GraczKomputery::Ustaw(float trudnosc1)
- {
- trudnosc = trudnosc1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement