Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iomanip>
- #include <iostream>
- #include <string>
- #include <vector>
- #include <fstream>
- #include <algorithm>
- #include <ctime>
- using namespace std;
- class Person {
- public:
- string name;
- string surname;
- Person();
- Person(const string& a, const string& b) {
- name_ = a;
- surname_ = b;
- }
- void Show() {
- std::cout << "Name: " << name << "\nSurname: " << surname << "\n";
- }
- private:
- string name_;
- string surname_;
- };
- class Gunslinger : virtual public Person {
- public:
- Gunslinger() : Person() {};
- Gunslinger(const string& a, const string& b, int cnt, int accure) : Person(a, b) {
- count_ = cnt;
- accuracy_ = accure;
- };
- double Draw() {
- return accuracy_;
- }
- void Show() {
- std::cout <<"Name: " << name << "\nSurname: " << surname << "\n"
- << "Competition count : " << count_ << "\n" << "Accuracy: " << accuracy_ << "\n";
- }
- private:
- int count_;
- double accuracy_;
- };
- class PokerPlayer : virtual public Person {
- public:
- PokerPlayer() : Person() {};
- PokerPlayer(const string& a, const string& b) : Person(a, b) {};
- int Draw() {
- srand(time(0));
- return 1 + rand() % 52;
- }
- void Show() {
- Person::Show();
- }
- };
- class BadDude : public Gunslinger, public PokerPlayer {
- public:
- BadDude() : Person(), Gunslinger(), PokerPlayer() {};
- BadDude(const string& a, const string& b, int gun_t) : Gunslinger(a, b, 0, 0), PokerPlayer(a, b), Person(a, b) {
- gun_time = gun_t;
- };
- double Gdraw() {
- return gun_time;
- }
- int Cdraw() {
- return PokerPlayer::Draw();
- }
- void Show() {
- Person::Show();
- }
- private:
- double gun_time;
- };
- int main() {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement