Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. class GraczKomputery;
  5. class Gracz
  6. {
  7.  
  8. protected:
  9.     int ilosc_gier;
  10.     int *punkty;
  11.  
  12.  
  13. public:
  14.     Gracz(int ilosc_gier1,int *punkty);
  15.     ~Gracz();
  16.     void Ustaw_Punkty(int ilosc_gier1, int *punkty);
  17.     float Srednia(int, int);
  18. };
  19. class GraczKomputery :public Gracz
  20. {
  21. public:
  22.     float trudnosc;
  23.     GraczKomputery();
  24.     void Ustaw(float trudnosc1);
  25.  
  26. };
  27.  
  28. int main()
  29. {
  30.     Gracz *gr= new Gracz(3, 0);
  31.     GraczKomputery komp();
  32.    
  33.  
  34.    
  35. }
  36.  
  37.  
  38. Gracz::Gracz(int ilosc_gier1, int *punkty1)
  39. {
  40.     ilosc_gier = ilosc_gier1;
  41.     int *punkty = new int[ilosc_gier1];
  42.  
  43.     for (int i = 0; i < ilosc_gier1; i++)
  44.     {
  45.         punkty[i] = 0;
  46.     }
  47. }
  48.  
  49. Gracz::~Gracz()
  50. {
  51.     delete[]punkty;
  52. }
  53.  
  54. void Gracz::Ustaw_Punkty(int ilosc_gier1, int *punkty1)
  55. {
  56.  
  57.     ilosc_gier = ilosc_gier1;
  58.    
  59.  
  60.  
  61.  
  62.  
  63.    
  64.  
  65. }
  66.  
  67. float Gracz::Srednia(int, int)
  68. {
  69.     return 0.0;
  70. }
  71.  
  72. void GraczKomputery::Ustaw(float trudnosc1)
  73. {
  74.     trudnosc = trudnosc1;
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement