- 两个派生类都有CalculateArea()函数计算几何图形的面积。
#include<iostream>
using namespace std;
const double pi = 3.14159;
class Shape
{
protected:
double a, b, s;
public:
Shape() {
s = 0; }
Shape(double x
#include<iostream>
using namespace std;
const double pi = 3.14159;
class Shape
{
protected:
double a, b, s;
public:
Shape() {
s = 0; }
Shape(double x