Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- class Kandydat
- {
- string imie;
- string nazwisko;
- unsigned id;
- unsigned liczba_glosow;
- public:
- Kandydat(string, string, unsigned);
- void dodaj_glosy(unsigned);
- void wypisz_dane();
- };
- Kandydat::Kandydat(string name, string scndname, unsigned ident) : imie(name), nazwisko(scndname), id(ident), liczba_glosow(0) {}
- void Kandydat::dodaj_glosy(unsigned ile)
- {
- liczba_glosow += ile;
- }
- void Kandydat::wypisz_dane()
- {
- cout << id << ' ' << imie << ' ' << nazwisko << "\t\tliczba glosow: " << liczba_glosow << endl;
- }
- class Okreg
- {
- unsigned nr_okregu;
- };
- int main()
- {
- Kandydat nowy("Adam", "Kowalski", 1);
- nowy.dodaj_glosy(500);
- nowy.dodaj_glosy(1000);
- nowy.wypisz_dane();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement