C++函数重载算面积
C++函数重载算面积
日期:2021-11-04 01:53:18 人气:1
C++函数重载算面积的程序:
#include <iostream>
#include <stdexcept>
#include <cmath>
struct Shape {
virtual ~Shape() = 0 {}
virtual double area() const = 0;
};
class Circle : public Shape {
double r_;
#include <iostream>
#include <stdexcept>
#include <cmath>
struct Shape {
virtual ~Shape() = 0 {}
virtual double area() const = 0;
};
class Circle : public Shape {
double r_;