#include<iostream>
#include<math.h>
using namespace std;
const float pi = 3.14f;
float area(float r)
{
return pi * r * r;
}
float area(float x, float y)
{
return x * y;
}
float area(float a, float b, float c)
{
float p,s;
p = (a + b + c)/2;
s = sqrt(p*(p - a)*(p - b)*(p - c));
return s;
}
int main()
{
float r, x, y, a, b, c;
cout << "请输入圆的半径:";
cin >> r;
cout << "请输入矩形的长和宽:";
cin >> x >> y;
cout << "请输入三角形的三条边:";
cin >> a >> b >> c;
cout << "圆的面积为:" << area(r) << endl; //调用求圆面积的函数
cout << "矩形的面积为:" << area(x, y) << endl; //调用求矩形面积的函数
cout << "三角形的面积为:" << area(a, b, c) << endl; //调用求三角形面积的函数
return 0;
}