⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shape.cpp

📁 visual c++源码一定对你有一定的帮助
💻 CPP
字号:
#include    <stdio.h>

class Shape
{
public:
    void Draw();
    void Show();
};

class Circle : public Shape
{
public:
    void Draw();
};

class Square : public Shape
{
public:
    void Draw();
};

void main (void)
{
Circle circle;
Square square;

    circle.Show();
    square.Show();
}

void Shape::Show()
{
    printf ("Shape::Show is used to set up the ");
    printf ("output device for drawing,\n");
    printf ("then calls Draw()\n");
    Draw();
}

void Shape::Draw()
{
    printf ("Shape::Draw ");
    printf ("draws a circle within a square\n");
}

void Circle::Draw()
{
    printf ("Circle::Draw ");
    printf ("draws only the circle\n");
}

void Square::Draw()
{
    printf ("Square::Draw ");
    printf ("draws only the square\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -