#include using namespace std; class Rycerz { public: // W klasach: ustawienie domyślne - private. string imie; private: int zdobycze; double sila; public: int PodajZdobycze (); double PodajSile (); void UstawZdobycze (int); void UstawSile (double); void Status (); } ; int Rycerz::PodajZdobycze () { return zdobycze; } double Rycerz::PodajSile () { return sila; } void Rycerz::UstawZdobycze (int x) { zdobycze = x; } void Rycerz::UstawSile (double x) { sila = x; } void Rycerz::Status () { cout << "Rycerz " << imie << " ma zdobyczy: " << zdobycze << " i sile: " << sila << "%\n"; } int main () { Rycerz Zorro; Zorro.imie = "Zorro"; Zorro.UstawZdobycze (0); Zorro.UstawSile (100.); Zorro.Status(); Zorro.UstawZdobycze ( Zorro.PodajZdobycze() + 1); Zorro.UstawSile (Zorro.PodajSile() * 0.9) ; Zorro.Status(); return 0; }