/*create a program with an area function that is overloaded to calcuilate
the area of a circle (given the radius)
the area of rectangle (given length and width)
the area of triangle (given the three side of the triangle)*/
#include <iostream>
using namespace std;
#include <cmath>

#define PI 3.14159

// Area of a circle
double area(double radius) {
    return PI * radius * radius;
}

// Area of a rectangle
double area(double length, double width) {
    return length * width;
}

// Area of a triangle using Heron's formula
double area(double a, double b, double c) {
    double s = (a + b + c) / 2; // semi-perimeter
    return sqrt(s * (s - a) * (s - b) * (s - c));
}

int main() {
    std::cout << "Area of circle (r=5): " << area(5.0) << std::endl;
    std::cout << "Area of rectangle (l=4, w=6): " << area(4.0, 6.0) << std::endl;
    std::cout << "Area of triangle (sides=3,4,5): " << area(3.0, 4.0, 5.0) << std::endl;

    return 0;
}